Click or drag to resize

IChannelQueryAsyncTDocument Method (CollectionNamespace, BsonDocument, BsonDocument, IElementNameValidator, Int32, Int32, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, IBsonSerializerTDocument, MessageEncoderSettings, CancellationToken)

Note: This API is now obsolete.

Executes a Query protocol.

Namespace:  MongoDB.Driver.Core.Bindings
Assembly:  MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.19.1+3a2a09dd959482f665ffbb5df2557ec541597af4
Syntax
[ObsoleteAttribute("Use an overload that does not have an oplogReplay parameter instead.")]
Task<CursorBatch<TDocument>> QueryAsync<TDocument>(
	CollectionNamespace collectionNamespace,
	BsonDocument query,
	BsonDocument fields,
	IElementNameValidator queryValidator,
	int skip,
	int batchSize,
	bool secondaryOk,
	bool partialOk,
	bool noCursorTimeout,
	bool oplogReplay,
	bool tailableCursor,
	bool awaitData,
	IBsonSerializer<TDocument> serializer,
	MessageEncoderSettings messageEncoderSettings,
	CancellationToken cancellationToken
)

Parameters

collectionNamespace
Type: MongoDB.DriverCollectionNamespace
The collection namespace.
query
Type: MongoDB.BsonBsonDocument
The query.
fields
Type: MongoDB.BsonBsonDocument
The fields.
queryValidator
Type: MongoDB.Bson.IOIElementNameValidator
The query validator.
skip
Type: SystemInt32
The number of documents to skip.
batchSize
Type: SystemInt32
The size of a batch.
secondaryOk
Type: SystemBoolean
if set to true sets the SecondaryOk bit to true in the query message sent to the server.
partialOk
Type: SystemBoolean
if set to true the server is allowed to return partial results if any shards are unavailable.
noCursorTimeout
Type: SystemBoolean
if set to true the server will not timeout the cursor.
oplogReplay
Type: SystemBoolean
if set to true the OplogReplay bit will be set.
tailableCursor
Type: SystemBoolean
if set to true the query should return a tailable cursor.
awaitData
Type: SystemBoolean
if set to true the server should await awhile before returning an empty batch for a tailable cursor.
serializer
Type: MongoDB.Bson.SerializationIBsonSerializerTDocument
The serializer.
messageEncoderSettings
Type: MongoDB.Driver.Core.WireProtocol.Messages.EncodersMessageEncoderSettings
The message encoder settings.
cancellationToken
Type: System.ThreadingCancellationToken
The cancellation token.

Type Parameters

TDocument
The type of the document.

Return Value

Type: TaskCursorBatchTDocument
A Task whose result is the result of the Insert protocol.
See Also