rename-collection
Rename a MongoDB collection by specifying database, current name, and new name. Optionally drop an existing target collection to avoid conflicts.
Instructions
Renames a collection in a MongoDB database
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newName | Yes | The new name for the collection | |
| database | Yes | Database name | |
| collection | Yes | Collection name | |
| dropTarget | No | If true, drops the target collection if it exists |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| renamed | Yes | ||
| database | Yes | ||
| newCollection | Yes | ||
| oldCollection | Yes |