[SERVER-17929] Add full query support for $meta values geoNearDistance/geoNearPoint Created: 08/Apr/15  Updated: 28/Dec/23

Status: Backlog
Project: Core Server
Component/s: Geo, Querying
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: J Rassi Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: qi-geo
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-18056 2d nearSphere performance regression Closed
related to SERVER-12335 indexKey $meta projection not populat... Closed
is related to SERVER-17920 InternalError when using geoNear $met... Closed
Assigned Teams:
Query Integration
Participants:

 Description   

The $meta values "geoNearDistance"/"geoNearPoint" should be given full query support.

Exposing "geoNearDistance" to users will allow them to get off of the $near/$nearSphere query operators, which suffer from no real query planner support and poor semantics.

For example:

  • Preferred: find({geo: {$geoWithin: ...}}, {dist: {$meta: "geoNearDistance"}}).sort({dist: {$meta: "geoNearDistance"}})
  • Not preferred: find({geo: {$nearSphere: ...}})


 Comments   
Comment by Siyuan Zhou [ 15/Apr/15 ]

If $near is considered as projection and sorting explicitly, we don't have to enforce the use of geo index if another normal index can be more efficient, see SERVER-18056.

Generated at Thu Feb 08 03:46:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.