[SERVER-58745] Expose computeGeoNearDistance() as an internal-only DocumentSource Created: 22/Jul/21  Updated: 29/Oct/23  Resolved: 12/Aug/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: Task Priority: Major - P3
Reporter: David Percy Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-58602 Rewrite $geoNear to $geoWithin + comp... Closed
Related
is related to SERVER-84974 Investigate $geoNear blocking sort Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Optimization 2021-07-26, Query Optimization 2021-08-09, QO 2021-08-23
Participants:

 Description   

$geoNear sorts documents by their distance from a given query point. Conceptually it both:
1. computes the distance, storing the result in the document metadata
2. sorts by that distance

The second step we can already express with $sort $meta.

Let's expose the first step as a new internal DocumentSource. The syntax might look something like this:

{$_internalComputeGeoNearDistance: {
  near: <point>,
  key: <fieldname>,
}}

Then a future ticket (SERVER-58602) can use this to allow $geoNear to execute anywhere in a pipeline.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 12/Aug/21 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-58745 Expose computeGeoNearDistance() as an internal-only DocumentSource
Branch: master
https://github.com/mongodb/mongo/commit/41d1ddba874968ba0268ba16adaf1823d027b5a2

Generated at Thu Feb 08 05:45:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.