code | type | title | description |
---|---|---|---|
true |
page |
getIndexAndCollection | Framework | Core |
KuzzleRequest class getIndexAndCollection() method |
Returns the index and collection specified in the request.
getIndexAndCollection (): { index: string, collection: string }
const { index, collection } = request.getIndexAndCollection();
// equivalent
const { index, collection } = request.input.args;
//+ checks to make sure that "index" and "collection" are of the right type
// and throw standard API error when it's not the case