Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 640 Bytes

File metadata and controls

31 lines (22 loc) · 640 Bytes
code type title description
true
page
getIndexAndCollection | Framework | Core
KuzzleRequest class getIndexAndCollection() method

getIndexAndCollection

Returns the index and collection specified in the request.

Arguments

getIndexAndCollection (): { index: string, collection: string }

Example

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