Details
-
Improvement
-
Status: Backlog
-
Major - P3
-
Resolution: Unresolved
-
None
-
None
-
None
-
Query Integration
Description
Add a way to specify minDistance to $geoWithin allowing querying for being in a ring shape, analogous to what $near/$nearSphere allowed with $minDistance and $maxDistance options.
The only current workaround if $geoNear aggregation stage cannot be used is this query:
{$and:[
|
{$nor:[
|
{center:{
|
$geoWithin:{$centerSphere:[ [ <x>,<y> ],<minDistance-in-radians>]}
|
}}
|
]},
|
{center:{
|
$geoWithin:{$centerSphere:[ [ <x>, <y> ],<maxDistance-in-radians>]}
|
}}
|
]}
|
Â
Original description:
With the deprecation of count in favor of countDocuments it is no longer possible to use the $near operator with the new API.
Unfortunately the alternative $geoWithin $center only supports radius whereas $near allowed having a ring specified by $minDistance & $maxDistance.
There's no workaround for this, $geoWithin seems to only supports single ringed structures, so this might be more a server issue than a driver one.