[SERVER-58604] Allow $geoNear 'near' argument to be a let variable Created: 15/Jul/21 Updated: 29/Oct/23 Resolved: 06/Sep/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | David Percy | Assignee: | Milena Ivanova |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||
| Sprint: | Query Optimization 2021-07-26, QO 2021-09-06, Query Optimization 2021-08-09, QO 2021-09-20, QO 2021-08-23 | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Description |
|
Currently, 'near' has to be a literal array (or GeoJSON object): > db.c.aggregate([ {$geoNear: {near: [0, 0]}} ] Instead we should allow it to be an expression: > db.c.aggregate([ {$geoNear: {near: "$$pt"}} ], {let: {pt: [0, 0]}}) It doesn't make sense to allow the query point to vary per-document, so it has to be a constant expression. We also want to allow 'near' to be bound in a $lookup:
The expression "$$pt" is constant within each subquery. To make this work I think we'll want to:
|
| 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 [ 21/Sep/21 ] |
|
Author: {'name': 'Milena Ivanova', 'email': 'milena.ivanova@mongodb.com', 'username': 'mivanova3'}Message: |
| Comment by Githook User [ 06/Sep/21 ] |
|
Author: {'name': 'Milena Ivanova', 'email': 'milena.ivanova@mongodb.com', 'username': 'mivanova3'}Message: |
| Comment by Githook User [ 06/Sep/21 ] |
|
Author: {'name': 'Milena Ivanova', 'email': 'milena.ivanova@mongodb.com', 'username': 'mivanova3'}Message: |