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
.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,hasSome() |
label | eq() ,ne() ,startsWith() ,hasSome() ,exists() ,in() ,ascending() ,descending() |
postCount | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,in() ,ascending() ,descending() |
title | eq() ,ne() ,startsWith() ,hasSome() ,exists() ,in() ,ascending() ,descending() |
rank | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,in() ,ascending() ,descending() |
displayPosition | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,in() ,ascending() ,descending() |
translationId | eq() ,ne() ,exists() ,in() |
language | eq() ,ne() ,exists() ,in() ,ascending() ,descending() |
slug | hasSome() ,ascending() ,descending() |
Options specifying which fields to return.