Click or drag to resize

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

Executes a Query protocol.

Namespace:  MongoDB.Driver.Core.Bindings
Assembly:  MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.12.2+a4a3888f4fb51bb518b1eb5002effc2d47f2ea6a
Syntax
Task<CursorBatch<TDocument>> QueryAsync<TDocument>(
	CollectionNamespace collectionNamespace,
	BsonDocument query,
	BsonDocument fields,
	IElementNameValidator queryValidator,
	int skip,
	int batchSize,
	bool slaveOk,
	bool partialOk,
	bool noCursorTimeout,
	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.
slaveOk
Type: SystemBoolean
if set to true sets the SlaveOk 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.
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