find( )


Returns the resource catalog items that match the query.

The find() function returns a Promise that resolves to the results found by the query and some information about the results. The Promise is rejected if find() is called with incorrect permissions or if any of the functions used to refine the query are invalid.

Use the options parameter to run find() without checking for permissions.

Method Declaration
Copy
function find(options: QueryOptions): Promise<ResourceCatalogQueryResult>;
Method Parameters
optionsQueryOptions

Options to use when performing a query.

Returns
Return Type:Promise<ResourceCatalogQueryResult>
JavaScript
import { resources } from "wix-bookings-backend"; // ... resources .queryResourceCatalog() .find() .then((results) => { if (results.items.length > 0) { const items = results.items; const firstItem = items[0]; const totalCount = results.totalCount; const pageSize = results.pageSize; const currentPage = results.currentPage; const totalPages = results.totalPages; const hasNext = results.hasNext(); const hasPrev = results.hasPrev(); const length = results.length; const query = results.query; } else { // handle case where no matching items found } }) .catch((error) => { console.error(error); });
Errors

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

Did this help?