summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/canonical_query.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/canonical_query.cpp')
-rw-r--r--src/mongo/db/query/canonical_query.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/query/canonical_query.cpp b/src/mongo/db/query/canonical_query.cpp
index 6d2337d92ef..3d15afafe6c 100644
--- a/src/mongo/db/query/canonical_query.cpp
+++ b/src/mongo/db/query/canonical_query.cpp
@@ -404,6 +404,12 @@ Status CanonicalQuery::isValid(MatchExpression* root, const QueryRequest& parsed
return Status(ErrorCodes::BadValue, "text and tailable cursor not allowed in same query");
}
+ // NEAR and tailable are incompatible.
+ if (numGeoNear > 0 && parsed.isTailable()) {
+ return Status(ErrorCodes::BadValue,
+ "Tailable cursors and geo $near cannot be used together");
+ }
+
// $natural sort order must agree with hint.
if (sortNaturalElt) {
if (!hintObj.isEmpty() && !hintNaturalElt) {