create-index
Generate indexes for MongoDB collections to optimize query performance. Specify database, collection, and index keys to enhance data retrieval efficiency.
Instructions
Create an index for a collection
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection | Yes | Collection name | |
| database | Yes | Database name | |
| keys | Yes | The index definition | |
| name | No | The name of the index |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"collection": {
"description": "Collection name",
"type": "string"
},
"database": {
"description": "Database name",
"type": "string"
},
"keys": {
"additionalProperties": {},
"description": "The index definition",
"properties": {},
"type": "object"
},
"name": {
"description": "The name of the index",
"type": "string"
}
},
"required": [
"database",
"collection",
"keys"
],
"type": "object"
}