Search.../

Introduction

The MembershipsQueryBuilder functions enable you to run, sort, filter, and control which results a query returns.

Typically, you build a query using the queryMemberships() function, refine the query by chaining MembershipsQueryBuilder functions, and then execute the query by chaining the find() function.

For example, the following code returns the site member's first 5 group memberships with admin roles.

import { members } from 'wix-groups-backend';
members.queryMemberships()
.eq("role", "ADMIN")
.limit(5)
.find()
.then( (results) => {
console.log(results.items);
});
javascript | Copy Code

Was this helpful?