← All procedures
mongo.indexes.drop
Drop an index from a collection
MCPCLI- Package
- @procedures/mongo · README
- Path
["mongo","indexes","drop"]- CLI
mark mongo indexes drop --indexName <string>- MCP tool
mongo.indexes.drop on the dev-tools server- As data
{"$proc":["mongo","indexes","drop"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/mongo"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["mongo","indexes","drop"], { indexName: "<indexName>" });
console.log(JSON.stringify(result));From the command line
$ mark mongo indexes drop --indexName <string>
As data, in a program
{
"$proc": ["mongo", "indexes", "drop"],
"input": { "indexName": "<indexName>" }
}Input
| Field | Type | Required | Default | Description |
|---|
collection | string | no | | The collection name. It takes the place of metadata.collection. |
database | string | no | | The database name (default: the database of the connection) |
indexName | string | yes | | The name of the index to drop |
Output
| Field | Type | Required | Default | Description |
|---|
acknowledged | boolean | yes | | True when the server confirmed the write |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"collection": {
"description": "The collection name. It takes the place of metadata.collection.",
"type": "string",
"minLength": 1
},
"database": {
"description": "The database name (default: the database of the connection)",
"type": "string",
"minLength": 1
},
"indexName": {
"type": "string",
"minLength": 1,
"description": "The name of the index to drop"
}
},
"required": [
"indexName"
]
},
"output": {
"type": "object",
"properties": {
"acknowledged": {
"type": "boolean",
"description": "True when the server confirmed the write"
}
},
"required": [
"acknowledged"
],
"additionalProperties": {}
}
}