Method RenameCollection
RenameCollection(string, string)
Renames a collection on this database.
public virtual CommandResult RenameCollection(string oldCollectionName, string newCollectionName)
Parameters
oldCollectionName
stringThe old name for the collection.
newCollectionName
stringThe new name for the collection.
Returns
- CommandResult
A CommandResult.
RenameCollection(string, string, bool)
Renames a collection on this database.
public virtual CommandResult RenameCollection(string oldCollectionName, string newCollectionName, bool dropTarget)
Parameters
oldCollectionName
stringThe old name for the collection.
newCollectionName
stringThe new name for the collection.
dropTarget
boolWhether to drop the target collection first if it already exists.
Returns
- CommandResult
A CommandResult.