databases_create_index
Create database indexes to optimize query performance by defining attributes for faster data retrieval in Appwrite collections.
Instructions
Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_id | Yes | Database ID. | |
| collection_id | Yes | Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
| key | Yes | Index Key. | |
| type | Yes | Index type. | |
| attributes | Yes | Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. | |
| orders | No | Array of index orders. Maximum of 100 orders are allowed. | |
| lengths | No | Length of index. Maximum of 100 |