diff options
Diffstat (limited to 'src/mongo/db/query/canonical_query.h')
-rw-r--r-- | src/mongo/db/query/canonical_query.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mongo/db/query/canonical_query.h b/src/mongo/db/query/canonical_query.h index 921b4eadb92..83fd713512a 100644 --- a/src/mongo/db/query/canonical_query.h +++ b/src/mongo/db/query/canonical_query.h @@ -92,7 +92,8 @@ public: MatchExpression* root); /** - * Returns true if "query" describes an exact-match query on _id. + * Returns true if "query" describes an exact-match query on _id, possibly with + * the $isolated/$atomic modifier. */ static bool isSimpleIdQuery(const BSONObj& query); @@ -170,6 +171,14 @@ public: return _canHaveNoopMatchNodes; } + /** + * Returns true if the query this CanonicalQuery was parsed from included a $isolated/$atomic + * operator. + */ + bool isIsolated() const { + return _isIsolated; + } + private: // You must go through canonicalize to create a CanonicalQuery. CanonicalQuery() {} @@ -190,6 +199,8 @@ private: std::unique_ptr<CollatorInterface> _collator; bool _canHaveNoopMatchNodes = false; + + bool _isIsolated; }; } // namespace mongo |