The CreateRequestsQueryBuilder
functions enable you to run, sort, filter, and control
which results a query returns.
Typically, you build a query using the queryCreateRequests()
function,
refine the query by chaining CreateRequestsQueryBuilder
functions, and then execute the
query by chaining the find()
function.
For example, the following code returns the first 5 requests to create a group that have been approved, and sorts them by created date in ascending order.
import { createRequests } from "wix-groups-backend";
createRequests
.queryCreateRequests()
.eq("status", "APPROVED")
.ascending("_createdDate")
.limit(5)
.find()
.then((results) => {
return results.items;
});