diff options
Diffstat (limited to 'src/mongo/db/clientcursor.h')
-rw-r--r-- | src/mongo/db/clientcursor.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h index 32fb018a8e1..f75d41e3089 100644 --- a/src/mongo/db/clientcursor.h +++ b/src/mongo/db/clientcursor.h @@ -71,6 +71,20 @@ struct ClientCursorParams { } } + void setTailable(bool tailable) { + if (tailable) + queryOptions |= QueryOption_CursorTailable; + else + queryOptions &= ~QueryOption_CursorTailable; + } + + void setAwaitData(bool awaitData) { + if (awaitData) + queryOptions |= QueryOption_AwaitData; + else + queryOptions &= ~QueryOption_AwaitData; + } + std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> exec; const NamespaceString nss; std::vector<UserName> authenticatedUsers; @@ -127,10 +141,23 @@ public: return _exec.get(); } + /** + * Returns the query options bitmask. If you'd like to know if the cursor is tailable or + * awaitData, prefer using the specific methods isTailable() and isAwaitData() over using this + * method. + */ int queryOptions() const { return _queryOptions; } + bool isTailable() const { + return _queryOptions & QueryOption_CursorTailable; + } + + bool isAwaitData() const { + return _queryOptions & QueryOption_AwaitData; + } + const BSONObj& getOriginatingCommandObj() const { return _originatingCommand; } |