queryStaffMembers( )


Creates a query to retrieve a list of staff members.

The queryStaffMembers() function builds a query to retrieve a list of staff members and returns an StaffMembersQueryBuilder 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 StaffMembersQueryBuilder functions onto the query. StaffMembersQueryBuilder functions enable you to sort, filter, and control the results queryStaffMembers() returns.

queryStaffMembers() runs with these StaffMembersQueryBuilder defaults, which you can override:

  • limit(50)
  • descending("_createdDate")

The functions that are chained to queryStaffMembers() are applied in the order they're called. For example, if you apply ascending('createdDate') and then descending('id'), the results are sorted first by the created date, and then, if there are multiple results with the same date, the items are sorted by ID.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),in(),ne(),ascending(),descending()
_createdDateeq(),ne(),lt(),le(),gt(),ge(),in(),exists(),ascending(),descending()
_updatedDateeq(),ne(),lt(),le(),gt(),ge(),in(),exists(),ascending(),descending()
Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Events
Learn more about app permissions.
Method Declaration
Copy
function queryStaffMembers(
  options: QueryStaffMembersOptions,
): StaffMembersQueryBuilder;
Method Parameters
optionsQueryStaffMembersOptions
Returns
JavaScript
import { staffMembers } from "@wix/events"; async function queryStaffMembers() { const { items } = await staffMembers.queryStaffMembers().find(); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?