spring-data-mongodb icon indicating copy to clipboard operation
spring-data-mongodb copied to clipboard

Fix rewrite of near & nearSphere count queries using geoJson to geoWithin.

Open christophstrobl opened this issue 3 years ago • 0 comments

$near and $nearSphere queries are not supported via countDocuments and the used aggregation match stage and need to be rewritten to $geoWithin. The existing logic did not cover usage of geoJson types, which is fixed now. In case of nearSphere it is also required to convert the $maxDistance argument (given in meters for geoJson) to radians which is used by $geoWithin $centerSphere.

Resolves: #4004

christophstrobl avatar Mar 23 '22 13:03 christophstrobl