> 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: descending(propertyName: Array) # Method package: wixPricingPlansBackend # Method menu location: wixPricingPlansBackend --> PublicPlansQueryBuilder --> descending # Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/public-plans-query-builder/descending.md # Method Description: Adds a sort to a query or sort, sorting by the specified properties in descending order. The `descending()` function refines a `PublicPlansQueryBuilder` to sort in descending order of the specified properties. If you specify more than one property, `descending()` sorts the results in descending 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 before `"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 a `descending` sort to a query ```javascript const query = wixPricingPlansBackend.queryPublicPlans().descending("_createdDate"); ``` ## Create a query, add a `descending` sort, and run it ```javascript import wixPricingPlansBackend from 'wix-pricing-plans-backend'; // ... wixPricingPlansBackend.queryPublicPlans() .descending("_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; }); ``` ---