-
Type: Improvement
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: 4.0.9
-
Component/s: Server
-
Labels:None
$geoWithin cannot contain an implicit $and and must only have one field. We should clearly indicate this in the documentation. There may be other operators that also need to be clarified.
Original Description
Parser rejects the following query:
{"coordinates": { "$geoWithin": {"$centerSphere": [[22, 52], 0.04]}, "$not": { "$geoWithin": {"$centerSphere": [[22, 52], 0.01]} } }}
with the following error:
{ "ok" : 0, "errmsg" : "can't parse extra field: $not: { $geoWithin: { $centerSphere: [ [ 22.0, 52.0 ], 0.001 ] } }", "code" : 2, "codeName" : "BadValue" }
Tested on Mongo 4.0.9