-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
It looks to me like this support was added in SERVER-59171 in an effort to make SERVER-58602 easier. However, SERVER-58602 didn't end up using this new syntax.
I think this is worth considering removing because "geoNearDistance" would likely want to be presented in ascending order (closest points should sort first). This is in contrast to all other types of metadata which assumed that all metadata should be sorted to return highest first (most notably text score). There is no syntactical way to get a sort by geoNearDistance to sort in any custom order (and consequently the order that makes sense). As a result, every single meta expression sorts in descending order. This is true at least for now as I file this - maybe in the future after SERVER-46298 or similar work you will be able to specify an expression and also an order.
- is related to
-
SERVER-58602 Rewrite $geoNear to $geoWithin + compute distance + $sort
- Closed
-
SERVER-46298 Support sorting by expressions other than field references
- Backlog
-
SERVER-59171 Allow {$meta: 'geoNearDistance'} syntax, at least internally
- Closed
-
SERVER-91278 Allow sorting by more kinds of metadata
- Closed
-
SERVER-35581 Don't mandate the use of "distanceField" in $geoNear
- In Progress