Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
This function is a helper to rename an existing collection on a MongoDB server.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
MongoDB | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
MongoDBRef | The reference number for the mongo connection. | $MongoDB | |
NewDatabase | The new name for the database. | ||
NewCollectionName | The new name of the collection. | ||
DropTargetBeforeRename | If an existing collection matches the new name, drop it before the rename. Pass 1 to drop or 0 to not drop and return an error in case of a name collision. Default is 0. |
0 | Optional |
Returns OK or error.
This function checks for a license.
Created 27th July 2022, last changed 27th July 2022