Class RetryableInsertCommandOperation<TDocument>
- Namespace
- MongoDB.Driver.Core.Operations
- Assembly
- MongoDB.Driver.Core.dll
Represents an insert command operation.
public class RetryableInsertCommandOperation<TDocument> : RetryableWriteCommandOperationBase, IWriteOperation<BsonDocument>, IRetryableWriteOperation<BsonDocument>, IExecutableInRetryableWriteContext<BsonDocument> where TDocument : class
Type Parameters
TDocument
The type of the document.
- Inheritance
-
RetryableInsertCommandOperation<TDocument>
- Implements
- Inherited Members
- Extension Methods
Constructors
RetryableInsertCommandOperation(CollectionNamespace, BatchableSource<TDocument>, IBsonSerializer<TDocument>, MessageEncoderSettings)
Initializes a new instance of the RetryableInsertCommandOperation<TDocument> class.
public RetryableInsertCommandOperation(CollectionNamespace collectionNamespace, BatchableSource<TDocument> documents, IBsonSerializer<TDocument> documentSerializer, MessageEncoderSettings messageEncoderSettings)
Parameters
collectionNamespace
CollectionNamespaceThe collection namespace.
documents
BatchableSource<TDocument>The documents.
documentSerializer
IBsonSerializer<TDocument>The document serializer.
messageEncoderSettings
MessageEncoderSettingsThe message encoder settings.
Properties
BypassDocumentValidation
Gets or sets a value indicating whether to bypass document validation.
public bool? BypassDocumentValidation { get; set; }
Property Value
- bool?
A value indicating whether to bypass document validation.
CollectionNamespace
Gets the collection namespace.
public CollectionNamespace CollectionNamespace { get; }
Property Value
- CollectionNamespace
The collection namespace.
DocumentSerializer
Gets the document serializer.
public IBsonSerializer<TDocument> DocumentSerializer { get; }
Property Value
- IBsonSerializer<TDocument>
The document serializer.
Documents
Gets the documents.
public BatchableSource<TDocument> Documents { get; }
Property Value
- BatchableSource<TDocument>
The documents.
Methods
CreateCommand(ICoreSessionHandle, int, long?)
Creates the command.
protected override BsonDocument CreateCommand(ICoreSessionHandle session, int attempt, long? transactionNumber)
Parameters
session
ICoreSessionHandleThe session.
attempt
intThe attempt.
transactionNumber
long?The transaction number.
Returns
- BsonDocument
A command.
CreateCommandPayloads(IChannelHandle, int)
Creates the command payloads.
protected override IEnumerable<Type1CommandMessageSection> CreateCommandPayloads(IChannelHandle channel, int attempt)
Parameters
channel
IChannelHandleThe channel.
attempt
intThe attempt.
Returns
- IEnumerable<Type1CommandMessageSection>
The command payloads.