IChannelInsertAsyncTDocument Method |
Executes an Insert protocol.
Namespace:
MongoDB.Driver.Core.Bindings
Assembly:
MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.5.0+57.Branch.master.Sha.6a4e00a2d91090c65a9b11364b9ebfdb9c7da076
Syntax Task<WriteConcernResult> InsertAsync<TDocument>(
CollectionNamespace collectionNamespace,
WriteConcern writeConcern,
IBsonSerializer<TDocument> serializer,
MessageEncoderSettings messageEncoderSettings,
BatchableSource<TDocument> documentSource,
Nullable<int> maxBatchCount,
Nullable<int> maxMessageSize,
bool continueOnError,
Func<bool> shouldSendGetLastError,
CancellationToken cancellationToken
)
Function InsertAsync(Of TDocument) (
collectionNamespace As CollectionNamespace,
writeConcern As WriteConcern,
serializer As IBsonSerializer(Of TDocument),
messageEncoderSettings As MessageEncoderSettings,
documentSource As BatchableSource(Of TDocument),
maxBatchCount As Nullable(Of Integer),
maxMessageSize As Nullable(Of Integer),
continueOnError As Boolean,
shouldSendGetLastError As Func(Of Boolean),
cancellationToken As CancellationToken
) As Task(Of WriteConcernResult)
abstract InsertAsync :
collectionNamespace : CollectionNamespace *
writeConcern : WriteConcern *
serializer : IBsonSerializer<'TDocument> *
messageEncoderSettings : MessageEncoderSettings *
documentSource : BatchableSource<'TDocument> *
maxBatchCount : Nullable<int> *
maxMessageSize : Nullable<int> *
continueOnError : bool *
shouldSendGetLastError : Func<bool> *
cancellationToken : CancellationToken -> Task<WriteConcernResult>
Parameters
- collectionNamespace
- Type: MongoDB.DriverCollectionNamespace
The collection namespace. - writeConcern
- Type: MongoDB.DriverWriteConcern
The write concern. - serializer
- Type: MongoDB.Bson.SerializationIBsonSerializerTDocument
The serializer. - messageEncoderSettings
- Type: MongoDB.Driver.Core.WireProtocol.Messages.EncodersMessageEncoderSettings
The message encoder settings. - documentSource
- Type: MongoDB.Driver.Core.MiscBatchableSourceTDocument
The document source. - maxBatchCount
- Type: SystemNullableInt32
The maximum batch count. - maxMessageSize
- Type: SystemNullableInt32
Maximum size of the message. - continueOnError
- Type: SystemBoolean
if set to true the server will continue with subsequent Inserts even if errors occur. - shouldSendGetLastError
- Type: SystemFuncBoolean
A delegate that determines whether to piggy-back a GetLastError messsage with the Insert message. - cancellationToken
- Type: System.ThreadingCancellationToken
The cancellation token.
Type Parameters
- TDocument
- The type of the document.
Return Value
Type:
TaskWriteConcernResultA Task whose result is the result of the Insert protocol.
See Also