We should allow queries such as
a: { $near: ..., $within: ... }
, but geonear predicates cannot be combined with other predicates in the same field, so we have to do for example,
$and: [ { a: { $near:... } }, { a: { $within: ... } } ]
. Also, ordering shouldn't matter.
In addition, for legacy formats for geonear queries, currently ordering matters and is incorrect in that for example,
a: { $eq: ..., $near: ..., $maxDistance: ... }
would error, but
a: { $near: ..., $eq: ..., $maxDistance: ... }
would ignore the $eq.
- depends on
-
SERVER-19713 verify() failure when specifying $minDistance or $maxDistance without geoNear operator
- Closed
- duplicates
-
SERVER-22206 $near query operator should validate its arguments
- Closed
-
SERVER-17234 geoNear command should return error for invalid arguments
- Closed