diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/matcher/expression_geo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/matcher/expression_geo.cpp b/src/mongo/db/matcher/expression_geo.cpp index eb47d3db124..8135e0d9d8e 100644 --- a/src/mongo/db/matcher/expression_geo.cpp +++ b/src/mongo/db/matcher/expression_geo.cpp @@ -79,6 +79,12 @@ Status GeoExpression::parseQuery(const BSONObj& obj) { while (geoIt.more()) { BSONElement elt = geoIt.next(); + // $geoWithin doesn't accept multiple shapes. + if (geoContainer && queryElt.fieldNameStringData() == "$geoWithin"_sd) { + return Status(ErrorCodes::BadValue, + str::stream() << "$geoWithin doesn't accept multiple shapes " + << queryElt.toString()); + } if (elt.fieldNameStringData() == "$uniqueDocs") { // Deprecated "$uniqueDocs" field LOGV2_WARNING(23847, "Deprecated $uniqueDocs option", "query"_attr = redact(obj)); |