find( )


Returns the 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.

Method Declaration
Copy
function find(): Promise<PublicPlansQueryResult>;
Request
This method does not take any parameters
Returns
Return Type:Promise<PublicPlansQueryResult>
Perform a find on a query
JavaScript
import wixPricingPlansBackend from "wix-pricing-plans-backend"; // ... wixPricingPlansBackend .queryPublicPlans() .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) => { const queryError = error; });
Errors

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

Did this help?