Click or drag to resize

IChannelQueryTDocument Method

Executes a Query protocol.

Namespace:  MongoDB.Driver.Core.Bindings
Assembly:  MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.9.0+32b058abcdf2c7e8d9dd3a676d207b31897eee2e
Syntax
CursorBatch<TDocument> Query<TDocument>(
	CollectionNamespace collectionNamespace,
	BsonDocument query,
	BsonDocument fields,
	IElementNameValidator queryValidator,
	int skip,
	int batchSize,
	bool slaveOk,
	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.
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.
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: CursorBatchTDocument
The result of the Insert protocol.
See Also