find( )


Returns the resource catalog items that match the query.

The find() function returns a Promise that resolves to the results found by the query and some information about the results. The Promise is rejected if find() is called with incorrect permissions or if any of the functions used to refine the query are invalid.

Use the options parameter to run find() without checking for permissions.

Method Declaration
Copy
Method Parameters
optionsQueryOptions

Options to use when performing a query.

Returns
Return Type:Promise<ResourceCatalogQueryResult>
JavaScript
Did this help?

hasSome( )


Refines a query to match items whose specified property contains any of the specified value parameters.

The hasSome() function refines a ResourceCatalogQueryBuilder to only match items where the value of the specified property equals any of the specified values in the array.

Matching strings with hasSome() is case sensitive, so "text" is not equal to "Text".

You can specify a list of values to match by providing comma-separated String types as the value parameters. You can also specify a list of these values by including them in an array and providing the array as the value.

Method Declaration
Copy
Method Parameters
propertyNamestringRequired

The property whose values will be compared with value.

Supported properties:

  • _id
  • slugs.name

valueArray<string>Required

The values to match against.

Returns
JavaScript
Did this help?

limit( )


Limits the number of items the query returns.

The limit() function defines the number of results a query returns in each page. Only one page of results is retrieved at a time. The next() and prev() functions are used to navigate the pages of a query result.

By default, limit is set to 50.

The maximum value that limit() can accept is 1000.

Method Declaration
Copy
function limit(limit: number): ResourceCatalogQueryBuilder;
Method Parameters
limitnumberRequired

The number of items to return, which is also the pageSize of the results object.

Returns
JavaScript
let query = resources.queryResourceCatalog().limit(10);
Did this help?