> 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: listIndexes(dataCollectionId: string, options: ListIndexesOptions) # Method package: wixDataV2 # Method menu location: wixDataV2 --> indexes --> listIndexes # Method Link: https://dev.wix.com/docs/velo/apis/wix-data-v2/indexes/list-indexes.md # Method Description: Lists all indexes defined for a data collection. When an index's status is `ACTIVE`, it is ready to use. While it is still being created, its status is `BUILDING`. When an index's status is `DROPPED`, it has been dropped successfully. While it is still in the process of being removed, its status is `DROPPING`. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## List indexes (dashboard page code) ```javascript import { indexes } from "wix-data.v2"; /* * Sample dataCollectionId value = 'Jackets' * * Sample options value = { * limit: 5 * } */ export async function myListIndexesFunction(dataCollectionId, options) { try { const listIndexesResponse = await indexes.listIndexes(dataCollectionId, options); console.log(`List of indexes for this collection: ${listIndexesResponse.indexes}`); return listIndexesResponse; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to a list of indexes for the specified collection, with paging metadata: * { * "indexes": [ * { * "caseInsensitive": true, * "fields": [ * { * "order": "ASC" * "path": "itemName", * }, * { * "order": "DESC" * "path": "size", * } * ], * "name": "byItemNameAndSize", * "status": "ACTIVE", * "unique": false, * }, * { * "caseInsensitive": false * "fields": [ * { * "order": "ASC" * "path": "size", * }, * { * "order": "DESC" * "path": "available", * } * ], * "name": "bySizeAndAvailability", * "status": "ACTIVE", * "unique": false, * } * ], * "pagingMetadata": { * "count": 2, * "offset": 0, * "total": 2, * "tooManyToCount": false * } * } */ ``` ## List indexes (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { indexes } from 'wix-data.v2'; import { elevate } from 'wix-auth'; /* * Sample dataCollectionId value = 'Jackets' * * Sample options value = { * limit: 5 * } */ export const myListIndexesFunction = webMethod(Permissions.Anyone, async (dataCollectionId, options) => { try { const elevatedListIndexes = elevate(indexes.listIndexes); const listIndexesResponse = await elevatedListIndexes(dataCollectionId, options); console.log(`List of indexes for this collection: ${listIndexesResponse.indexes}`); return listIndexesResponse; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to a list of indexes for the specified collection, with paging metadata: * { * "indexes": [ * { * "caseInsensitive": true, * "fields": [ * { * "order": "ASC" * "path": "itemName", * }, * { * "order": "DESC" * "path": "size", * } * ], * "name": "byItemNameAndSize", * "status": "ACTIVE", * "unique": false, * }, * { * "caseInsensitive": false * "fields": [ * { * "order": "ASC" * "path": "size", * }, * { * "order": "DESC" * "path": "available", * } * ], * "name": "bySizeAndAvailability", * "status": "ACTIVE", * "unique": false, * } * ], * "pagingMetadata": { * "count": 2, * "offset": 0, * "total": 2, * "tooManyToCount": false * } * } */ ``` ---