Retrieves a list of up to 100 memberships, given the provided paging, sorting and filtering.
Creates a query to retrieve a list of memberships.
Note: Only site admins can query a site member's memberships. Site members can query their memberships. However, if the suppressAuth
option is set to true
, all permissions are overwritten, and all site members (including non-group members) can query a site member's memberships.
The queryMemberships()
function builds a query to retrieve a list of all memberships, and returns a MembershipsQueryBuilder 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 GroupMembersQueryBuilder
functions onto the query. GroupMembersQueryBuilder
functions enable you to sort, filter, and control the results that queryMemberships()
returns.
The results of the queryMemberships()
function are sorted by groupId
in descending order.
queryMemberships()
runs with this GroupMembersQueryBuilder
default, which you can override:
The following GroupMembersQueryBuilder
functions are supported for queryMemberships()
. For a full description of the Memberships object, see the object returned for the items
property in MembershipsQueryResult
.
Property | Supported Filters & Sorting |
---|---|
status | eq() , ne() |
role | eq() , ne() |