queryCategories( )


Creates a query to retrieve a list of categories.

The queryCategories() function builds a query to retrieve a list of up to 100 categories per language, and returns a CategoriesQueryBuilder object.

The returned object contains the query definition, which is typically used to run the query using the find() function.

You can refine the query by chaining CategoriesQueryBuilder functions to the query. CategoriesQueryBuilder functions enable you to sort, filter, and control the results that queryCategories returns. Any functions chained to the queryCategories() function are applied in the order that they are called.

queryCategories() runs with these CategoriesQueryBuilder defaults, which you can override.

The following CategoriesQueryBuilder functions are supported for queryCategories(). For a full description of the Categories object, see the object returned for the items property in CategoriesQueryResult.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),hasSome()
labeleq(),ne(),startsWith(),hasSome(),exists(),in(),ascending(),descending()
postCounteq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
titleeq(),ne(),startsWith(),hasSome(),exists(),in(),ascending(),descending()
rankeq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
displayPositioneq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
translationIdeq(),ne(),exists(),in()
languageeq(),ne(),exists(),in(),ascending(),descending()
slughasSome(),ascending(),descending()
Permissions
Read Blog
Manage Blog
Read Draft Blog Posts
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
optionsQueryCategoriesOptions

Options specifying which fields to return.

Returns
Was this helpful?
Yes
No