> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: ascending(propertyName: Array) # Method package: wixPricingPlansBackend # Method menu location: wixPricingPlansBackend --> PublicPlansQueryBuilder --> ascending # Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/public-plans-query-builder/ascending.md # Method Description: Adds a sort to a query, sorting by the specified properties in ascending order. The `ascending()` function refines a `PublicPlansQueryBuilder` to sort in ascending order of the specified properties. If you specify more than one property, `ascending()` sorts the results in ascending order by each property in the order they are listed. You can sort the following types: + Number: Sorts numerically. + Date: Sorts by date and time. + String: Sorts lexicographically, so `"abc"` comes after `"XYZ"`. If a property contains a number as a String, that value will be sorted alphabetically and not numerically. Items that do not have a value for the specified sort property are ranked lowest. When sorting, ascending order is: numbers, followed by symbols, and then letters. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Add an `ascending` sort to a query ```javascript const query = wixPricingPlansBackend.queryPublicPlans().ascending("_createdDate"); ``` ## Create a query, add an `ascending` sort, and run it ```javascript import wixPricingPlansBackend from 'wix-pricing-plans-backend'; // ... wixPricingPlansBackend.queryPublicPlans() .ascending("_createdDate") .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; }); ``` ---