rename-collection
Renames a MongoDB collection within a specified database, optionally replacing an existing collection with the same name. Simplifies collection management tasks in MongoDB Atlas.
Instructions
Renames a collection in a MongoDB database
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collection | Yes | Collection name | |
database | Yes | Database name | |
dropTarget | No | If true, drops the target collection if it exists | |
newName | Yes | The new name for the collection |
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"
},
"dropTarget": {
"default": false,
"description": "If true, drops the target collection if it exists",
"type": "boolean"
},
"newName": {
"description": "The new name for the collection",
"type": "string"
}
},
"required": [
"database",
"collection",
"newName"
],
"type": "object"
}