← 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

FieldTypeRequiredDefaultDescription
collectionstringnoThe collection name. It takes the place of metadata.collection.
databasestringnoThe database name (default: the database of the connection)
indexNamestringyesThe name of the index to drop

Output

FieldTypeRequiredDefaultDescription
acknowledgedbooleanyesTrue 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": {}
  }
}