renameCollection

abstract suspend fun renameCollection(newCollectionNamespace: MongoNamespace)

Rename the collection with oldCollectionName to the newCollectionName.

Parameters

newCollectionNamespace

the namespace the collection will be renamed to

Throws

com.mongodb.MongoServerException

if you provide a newCollectionName that is the name of an existing collection, or if the oldCollectionName is the name of a collection that doesn't exist


abstract suspend fun renameCollection(newCollectionNamespace: MongoNamespace, options: RenameCollectionOptions)

Rename the collection with oldCollectionName to the newCollectionName.

Parameters

newCollectionNamespace

the name the collection will be renamed to

options

the options for renaming a collection

Throws

com.mongodb.MongoServerException

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


abstract suspend fun renameCollection(clientSession: ClientSession, newCollectionNamespace: MongoNamespace)

Rename the collection with oldCollectionName to the newCollectionName.

Since

3.6

Parameters

clientSession

the client session with which to associate this operation

newCollectionNamespace

the namespace the collection will be renamed to

Throws

com.mongodb.MongoServerException

if you provide a newCollectionName that is the name of an existing collection, or if the oldCollectionName is the name of a collection that doesn't exist


abstract suspend fun renameCollection(    clientSession: ClientSession,     newCollectionNamespace: MongoNamespace,     options: RenameCollectionOptions)

Rename the collection with oldCollectionName to the newCollectionName.

Since

3.6

Parameters

clientSession

the client session with which to associate this operation

newCollectionNamespace

the name the collection will be renamed to

options

the options for renaming a collection

Throws

com.mongodb.MongoServerException

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