Class RenameCollectionOperation
- Namespace
- MongoDB.Driver.Core.Operations
- Assembly
- MongoDB.Driver.Core.dll
Represents a rename collection operation.
public class RenameCollectionOperation : IWriteOperation<BsonDocument>
- Inheritance
-
RenameCollectionOperation
- Implements
- Inherited Members
- Extension Methods
Constructors
RenameCollectionOperation(CollectionNamespace, CollectionNamespace, MessageEncoderSettings)
Initializes a new instance of the RenameCollectionOperation class.
public RenameCollectionOperation(CollectionNamespace collectionNamespace, CollectionNamespace newCollectionNamespace, MessageEncoderSettings messageEncoderSettings)
Parameters
collectionNamespace
CollectionNamespaceThe collection namespace.
newCollectionNamespace
CollectionNamespaceThe new collection namespace.
messageEncoderSettings
MessageEncoderSettingsThe message encoder settings.
Properties
CollectionNamespace
Gets the collection namespace.
public CollectionNamespace CollectionNamespace { get; }
Property Value
- CollectionNamespace
The collection namespace.
DropTarget
Gets or sets a value indicating whether to drop the target collection first if it already exists.
public bool? DropTarget { get; set; }
Property Value
- bool?
true
if the target collection should be dropped first if it already exists.; otherwise,false
.
MessageEncoderSettings
Gets the message encoder settings.
public MessageEncoderSettings MessageEncoderSettings { get; }
Property Value
- MessageEncoderSettings
The message encoder settings.
NewCollectionNamespace
Gets the new collection namespace.
public CollectionNamespace NewCollectionNamespace { get; }
Property Value
- CollectionNamespace
The new collection namespace.
WriteConcern
Gets or sets the write concern.
public WriteConcern WriteConcern { get; set; }
Property Value
- WriteConcern
The write concern.
Methods
Execute(IWriteBinding, CancellationToken)
Executes the operation.
public BsonDocument Execute(IWriteBinding binding, CancellationToken cancellationToken)
Parameters
binding
IWriteBindingThe binding.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- BsonDocument
The result of the operation.
ExecuteAsync(IWriteBinding, CancellationToken)
Executes the operation.
public Task<BsonDocument> ExecuteAsync(IWriteBinding binding, CancellationToken cancellationToken)
Parameters
binding
IWriteBindingThe binding.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<BsonDocument>
A Task whose result is the result of the operation.