rename Collection
suspend fun renameCollection(newCollectionNamespace: MongoNamespace, options: RenameCollectionOptions = RenameCollectionOptions())
Rename the collection with oldCollectionName to the newCollectionName.
Parameters
new Collection Namespace
the name the collection will be renamed to
options
the options for renaming a collection
See also
Throws
Mongo Server Exception
if you provide a newCollectionName that is the name of an existing collection and dropTarget is false, or if the oldCollectionName is the name of a collection that doesn't exist
suspend fun renameCollection(clientSession: ClientSession, newCollectionNamespace: MongoNamespace, options: RenameCollectionOptions = RenameCollectionOptions())
Rename the collection with oldCollectionName to the newCollectionName.
Since
3.6
Parameters
client Session
the client session with which to associate this operation
new Collection Namespace
the name the collection will be renamed to
options
the options for renaming a collection
See also
Throws
Mongo Server Exception
if you provide a newCollectionName that is the name of an existing collection and dropTarget is false, or if the oldCollectionName is the name of a collection that doesn't exist