items


itemsArray<Membership>Read-only

Returns the items that match the query.

The current page of memberships retrieved by the query.

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

To paginate your query results, use the MembershipsQueryResult 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 memberId value:'2ac55ba-b3cd-457f-2978-617832783d624' export const getQueryResultItems = webMethod(Permissions.Anyone, () => { return members .queryMemberships() .limit(3) .find({ memberId: memberId }) .then((results) => { if (results.items.length > 0) { return results.items; } else { console.log("No items found"); } }) .catch((error) => { console.error(error); }); }); /* items: * [ * { * "groupId": "937cd3db-e9be-4980-93c1-a6d767a11050" * "status": "JOINED" * "role": "MEMBER" * }, * { * "groupId": "7fe8e9e1-d050-4c86-9684-e7f231600a34" * "status": "PENDING" * "role": "MEMBER" * }, * { * "groupId": "2CD58761-d050-4c86-9684-e7f2316229b3" * "status": "JOINED" * "role": "ADMIN" * } * ] */
Did this help?