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
intThe request identifier.
collectionNamespace
CollectionNamespaceThe collection namespace.
query
BsonDocumentThe query.
fields
BsonDocumentThe fields.
queryValidator
IElementNameValidatorThe query validator.
skip
intThe number of documents to skip.
batchSize
intThe size of a batch.
secondaryOk
boolif set to
true
it is OK if the server is not the primary.partialOk
boolif set to
true
the server is allowed to return partial results if any shards are unavailable.noCursorTimeout
boolif set to
true
the server should not timeout the cursor.tailableCursor
boolif set to
true
the query should return a tailable cursor.awaitData
boolif 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
intThe request identifier.
collectionNamespace
CollectionNamespaceThe collection namespace.
query
BsonDocumentThe query.
fields
BsonDocumentThe fields.
queryValidator
IElementNameValidatorThe query validator.
skip
intThe number of documents to skip.
batchSize
intThe size of a batch.
secondaryOk
boolif set to
true
it is OK if the server is not the primary.partialOk
boolif set to
true
the server is allowed to return partial results if any shards are unavailable.noCursorTimeout
boolif set to
true
the server should not timeout the cursor.oplogReplay
boolif set to
true
the OplogReplay bit will be set.tailableCursor
boolif set to
true
the query should return a tailable cursor.awaitData
boolif 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.