Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
Description
The $geoWithin parser accepts multiple shapes (things like $center, $centerSphere, $geometry), but it ignores all but the last one.
// Only $center is used:
|
> db.c.find({loc: {$geoWithin: {$centerSphere: [[0, 80], 1], $center: [[0, 0], 5]}}})
|
{ "_id" : ObjectId("61dca5b1ef27df133baf5abd"), "loc" : [ 0, 0 ] }
|
|
|
// Only $centerSphere is used:
|
> db.c.find({loc: {$geoWithin: {$center: [[0, 0], 5], $centerSphere: [[0, 80], 1]}}})
|
This seems like a mistake. (If we really accepted multiple shapes, a more useful behavior would be union or intersection.) And the docs examples all use a single shape: https://docs.mongodb.com/manual/reference/operator/query/geoWithin/
We should consider fixing $_internalBucketGeoWithin in the same way.
Attachments
Issue Links
- related to
-
SERVER-62481 $_internalBucketGeoWithin parser is not strict enough
-
- Closed
-