Class CreateIndexesOperation
- Namespace
- MongoDB.Driver.Core.Operations
- Assembly
- MongoDB.Driver.Core.dll
Represents a create indexes operation.
public class CreateIndexesOperation : IWriteOperation<BsonDocument>
- Inheritance
-
CreateIndexesOperation
- Implements
- Inherited Members
- Extension Methods
Constructors
CreateIndexesOperation(CollectionNamespace, IEnumerable<CreateIndexRequest>, MessageEncoderSettings)
Initializes a new instance of the CreateIndexesOperation class.
public CreateIndexesOperation(CollectionNamespace collectionNamespace, IEnumerable<CreateIndexRequest> requests, MessageEncoderSettings messageEncoderSettings)
Parameters
collectionNamespace
CollectionNamespaceThe collection namespace.
requests
IEnumerable<CreateIndexRequest>The requests.
messageEncoderSettings
MessageEncoderSettingsThe message encoder settings.
Properties
CollectionNamespace
Gets the collection namespace.
public CollectionNamespace CollectionNamespace { get; }
Property Value
- CollectionNamespace
The collection namespace.
Comment
Gets or sets the comment.
public BsonValue Comment { get; set; }
Property Value
- BsonValue
The comment.
CommitQuorum
Gets or sets the commit quorum.
public CreateIndexCommitQuorum CommitQuorum { get; set; }
Property Value
MaxTime
Gets or sets the MaxTime.
public TimeSpan? MaxTime { get; set; }
Property Value
- TimeSpan?
The maxtime.
MessageEncoderSettings
Gets the message encoder settings.
public MessageEncoderSettings MessageEncoderSettings { get; }
Property Value
- MessageEncoderSettings
The message encoder settings.
Requests
Gets the create index requests.
public IEnumerable<CreateIndexRequest> Requests { get; }
Property Value
- IEnumerable<CreateIndexRequest>
The create index requests.
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.