Introduction

When you execute a query with the find() function, it returns a Promise that resolves to a GroupMembersQueryResult object. This object contains the items that match the query, information about the query itself, and functions for paging through the query results.

Did this help?

currentPage


currentPagenumberRead-only

Returns the index of the current results page number.

The currentPage is a zero-based index of the current page of results.

The page size is defined by the limit() function, can be retrieved using the pageSize property, and navigating through pages is done with the prev() and next() functions.

The currentPage property returns undefined if the query returned no results.

JavaScript
Did this help?

items


itemsArray<GroupMember>Read-only

Returns the items that match the query.

The current page of group members retrieved by the query.

Note: When no items match the query, the items array is empty.

To paginate your query results, use the GroupMembersQueryResult pagination properties and functions.

Perform a query and get the returned items from the result
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { members } from "wix-groups-backend"; // Sample groupId value: 'c5c8baa7-b3cd-457f-b4a7-6178327834c7' export const getQueryResultItems = webMethod(Permissions.Anyone, () => { return members .queryGroupMembers() .limit(3) .find({ groupId: groupId }) .then((results) => { if (results.items.length > 0) { return results.items; } else { console.log("No items found"); } }) .catch((error) => { console.error(error); }); }); /* items: * [ * { * "joinedDate": "2021-08-04T07:13:18.000Z" * "memberId": "7fe8e9e1-d050-4c86-9684-e7f231600a34" * "role": "MEMBER" * }, * { * "joinedDate": "2020-07-22T02:29:09.000Z" * "memberId": "937cd3db-e9be-4980-93c1-a6d767a11050" * "role": "MEMBER" * }, * { * "joinedDate": "2020-01-16T06:28:02.000Z" * "memberId": "2CD58761-d050-4c86-9684-e7f2316229b3" * "role": "ADMIN" * } * ] */
Did this help?