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
requestIdintThe request identifier.
collectionNamespaceCollectionNamespaceThe collection namespace.
queryBsonDocumentThe query.
fieldsBsonDocumentThe fields.
queryValidatorIElementNameValidatorThe query validator.
skipintThe number of documents to skip.
batchSizeintThe size of a batch.
secondaryOkboolif set to
trueit is OK if the server is not the primary.partialOkboolif set to
truethe server is allowed to return partial results if any shards are unavailable.noCursorTimeoutboolif set to
truethe server should not timeout the cursor.tailableCursorboolif set to
truethe query should return a tailable cursor.awaitDataboolif set to
truethe server should await data (used with tailable cursors).shouldBeSentFunc<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
requestIdintThe request identifier.
collectionNamespaceCollectionNamespaceThe collection namespace.
queryBsonDocumentThe query.
fieldsBsonDocumentThe fields.
queryValidatorIElementNameValidatorThe query validator.
skipintThe number of documents to skip.
batchSizeintThe size of a batch.
secondaryOkboolif set to
trueit is OK if the server is not the primary.partialOkboolif set to
truethe server is allowed to return partial results if any shards are unavailable.noCursorTimeoutboolif set to
truethe server should not timeout the cursor.oplogReplayboolif set to
truethe OplogReplay bit will be set.tailableCursorboolif set to
truethe query should return a tailable cursor.awaitDataboolif set to
truethe server should await data (used with tailable cursors).shouldBeSentFunc<bool>A delegate that determines whether this message should be sent.