Returns the 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.
function find(options: Options): Promise<GroupsQueryResult>;
Authorization options.
const queryResults = groups.queryGroups().find();
Refines a query to match items whose specified property value contains any of the specified values.
The hasSome()
function refines a GroupsQueryBuilder
to only
match items where any of the values of the array of the specified property equal any of
the specified values.
Matching with hasSome()
is case sensitive, so "text"
is not equal to "Text"
.
function hasSome(
propertyName: string,
values: Array<string>,
): GroupsQueryBuilder;
The property whose value will be compared with value
.
Supported property:
name
The value to match against.
const query = groups.queryGroups().hasSome("name", ["Parents", "Friends"]);
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
.
function limit(limit: string): GroupsQueryBuilder;
The number of items to return, which is also the pageSize
of the results object.
const query = groups.queryGroups().limit(10);
Refines a query to match items whose specified property value does not equal the specified value.
The ne()
function refines a GroupsQueryBuilder
to only
match items where the value of the specified property does not equal the specified value
.
It only matches values of the same type. For example, a number value stored as a String type does not match the same number stored as a Number type.
Matching strings with ne()
is case sensitive, so "text"
is not equal to "Text"
.
function ne(propertyName: string, value: any): GroupsQueryBuilder;
The property whose value will be compared with value
.
Supported property:
name
The value to match against.
const query = groups.queryGroups().ne("name", "Parents");
Adds an or
condition to the query.
The or()
function adds an inclusive or
condition to a GroupsQueryBuilder
. A query
with an or
returns all the items that match the query as defined up to
the or
function, the items that match the query passed to the or
function, and the items that match both.
The or()
function is designed to work with 2 or more queries.
If you use it on its own, it will return all the items that meet the query criteria.
function or(query: GroupsQueryBuilder): GroupsQueryBuilder;
A query to add to the initial query as an or
condition.
const query = query1.or(query2);