IChannelInsertTDocument Method |
Executes an Insert protocol.
Namespace: MongoDB.Driver.Core.BindingsAssembly: MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.3.0
Syntax WriteConcernResult Insert<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 Insert(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 WriteConcernResult
abstract Insert :
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 -> 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:
WriteConcernResultThe result of the Insert protocol.
See Also