Search.../

Introduction

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

Typically, you build a query with the queryPublicPlans() query function, refine the query by chaining PublicPlansQueryBuilder functions, and then execute the query with the find() function.

For example, the following code queries the non-primary public plans and logs the first 5 results to the console, sorted in ascending order by plan ID:

import wixPricingPlansBackend from 'wix-pricing-plans-backend';
wixPricingPlansBackend.queryPublicPlans()
.eq("primary", false)
.ascending("_createdDate")
.limit(5)
.find()
.then((results) => {
console.log(results.items);
} );
javascript | Copy Code

Was this helpful?