Table of Contents

Method RenameCollectionAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

RenameCollectionAsync(string, string, RenameCollectionOptions, CancellationToken)

Renames the collection.

Task RenameCollectionAsync(string oldName, string newName, RenameCollectionOptions options = null, CancellationToken cancellationToken = default)

Parameters

oldName string

The old name.

newName string

The new name.

options RenameCollectionOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task.

RenameCollectionAsync(IClientSessionHandle, string, string, RenameCollectionOptions, CancellationToken)

Renames the collection.

Task RenameCollectionAsync(IClientSessionHandle session, string oldName, string newName, RenameCollectionOptions options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

oldName string

The old name.

newName string

The new name.

options RenameCollectionOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task.