Table of Contents

Constructor QueryMessage

Namespace
MongoDB.Driver.Core.WireProtocol.Messages
Assembly
MongoDB.Driver.Core.dll

QueryMessage(int, CollectionNamespace, BsonDocument, BsonDocument, IElementNameValidator, int, int, bool, bool, bool, bool, bool, Func<bool>)

Initializes a new instance of the QueryMessage class.

public QueryMessage(int requestId, CollectionNamespace collectionNamespace, BsonDocument query, BsonDocument fields, IElementNameValidator queryValidator, int skip, int batchSize, bool secondaryOk, bool partialOk, bool noCursorTimeout, bool tailableCursor, bool awaitData, Func<bool> shouldBeSent = null)

Parameters

requestId int

The request identifier.

collectionNamespace CollectionNamespace

The collection namespace.

query BsonDocument

The query.

fields BsonDocument

The fields.

queryValidator IElementNameValidator

The query validator.

skip int

The number of documents to skip.

batchSize int

The size of a batch.

secondaryOk bool

if set to true it is OK if the server is not the primary.

partialOk bool

if set to true the server is allowed to return partial results if any shards are unavailable.

noCursorTimeout bool

if set to true the server should not timeout the cursor.

tailableCursor bool

if set to true the query should return a tailable cursor.

awaitData bool

if set to true the server should await data (used with tailable cursors).

shouldBeSent Func<bool>

A delegate that determines whether this message should be sent.

QueryMessage(int, CollectionNamespace, BsonDocument, BsonDocument, IElementNameValidator, int, int, bool, bool, bool, bool, bool, bool, Func<bool>)

Initializes a new instance of the QueryMessage class.

[Obsolete("Use a constructor that does not have an oplogReplay parameter instead.")]
public QueryMessage(int requestId, CollectionNamespace collectionNamespace, BsonDocument query, BsonDocument fields, IElementNameValidator queryValidator, int skip, int batchSize, bool secondaryOk, bool partialOk, bool noCursorTimeout, bool oplogReplay, bool tailableCursor, bool awaitData, Func<bool> shouldBeSent = null)

Parameters

requestId int

The request identifier.

collectionNamespace CollectionNamespace

The collection namespace.

query BsonDocument

The query.

fields BsonDocument

The fields.

queryValidator IElementNameValidator

The query validator.

skip int

The number of documents to skip.

batchSize int

The size of a batch.

secondaryOk bool

if set to true it is OK if the server is not the primary.

partialOk bool

if set to true the server is allowed to return partial results if any shards are unavailable.

noCursorTimeout bool

if set to true the server should not timeout the cursor.

oplogReplay bool

if set to true the OplogReplay bit will be set.

tailableCursor bool

if set to true the query should return a tailable cursor.

awaitData bool

if set to true the server should await data (used with tailable cursors).

shouldBeSent Func<bool>

A delegate that determines whether this message should be sent.