queryGroups( )

Creates a query to retrieve a list of groups.

Note: For SECRET groups, only site admins, group admins, and group members can query groups and their content. However, if the suppressAuth option is set to true, all permissions are overwritten, and all site members (including non-group members) can query groups and their content.

The queryGroups() function builds a query to retrieve a list of all groups, and returns a GroupsQueryBuilder 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 GroupsQueryBuilder functions onto the query. GroupsQueryBuilder functions enable you to sort, filter, and control the results that queryGroups() returns.

queryGroups() runs with these GroupsQueryBuilder defaults, which you can override:

The following GroupsQueryBuilder functions are supported for queryGroups(). For a full description of the Groups object, see the object returned for the items property in GroupsQueryResult.

PropertySupported Filters & Sorting
nameeq(), ne(), startsWith(), endsWith(), contains(),hasSome(), ascending(), descending(), or()
_createdDateascending(), descending()
memberCountascending(), descending()
lastActivityDateascending(), descending()
Method Declaration
This method does not take any parameters
Was this helpful?