Click or drag to resize

IChannelQueryTDocument 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.22.0+75246110ed1247226fcc7f8eb2c54ffab745693e
Syntax
CursorBatch<TDocument> Query<TDocument>(
	CollectionNamespace collectionNamespace,
	BsonDocument query,
	BsonDocument fields,
	IElementNameValidator queryValidator,
	int skip,
	int batchSize,
	bool secondaryOk,
	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.
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.
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: CursorBatchTDocument
The result of the Insert protocol.
See Also