Creates a query to retrieve a list of policies, given the provided paging and filter.
The queryPolicies()
function builds a query to retrieve a list of policies and returns a PoliciesQueryBuilder 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 PoliciesQueryBuilder
functions onto the query. PoliciesQueryBuilder
functions enable you to sort, filter and control the results that PoliciesQueryBuilder.find()
returns.
The query runs with the following PoliciesQueryBuilder
defaults that you can override:
limit
: 50
descending
: _createdDate
The functions that are chained to queryPolicies()
are applied in the order they are called. For example, if you sort on the _createdDate
property in ascending order and then on the id property in descending order, the results are sorted by the created date and then, if there are multiple results with the same date, the items are sorted by the id.
The table below shows which PoliciesQueryBuilder
functions are supported for queryPoliciesGuests()
. You can only use one filter function for each property. If a property is used in more than one filter, only the first filter will work.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,in() ,exists() ,ascending() ,descending() |
revision | eq() ,ne() ,in() ,lt() ,le() ,gt() ,ge() ,exists() ,ascending() ,descending() |
_createdDate | eq() ,ne() ,in() ,lt() ,le() ,gt() ,ge() ,exists() ,ascending() ,descending() |
_updatedDate | eq() ,ne() ,in() ,lt() ,le() ,gt() ,ge() ,exists() ,ascending() ,descending() |
name | eq() ,ne() ,in() ,exists() ,ascending() ,descending() |
body | eq() ,ne() ,in() ,exists() ,ascending() ,descending() |
eventId | eq() ,ne() ,in() ,exists() ,ascending() ,descending() |