Click or drag to resize
IChannelInsertTDocument Method
Executes an Insert protocol.

Namespace: MongoDB.Driver.Core.Bindings
Assembly: 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
)

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: WriteConcernResult
The result of the Insert protocol.
See Also