[SERVER-1981] Support $near and $nearSphere predicates on sharded collections Created: 20/Oct/10 Updated: 15/May/18 Resolved: 28/Dec/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo, Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.7.1 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Mathias Stearn | Assignee: | Tess Avitabile (Inactive) |
| Resolution: | Done | Votes: | 22 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Sprint: | Query 2018-01-01 | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Description |
|
Currently, users who wish to execute near queries against sharded collections must use either the geoNear command or the $geoNear aggregation stage. The $near and $nearSphere query predicates, on the other hand, will fail when issued against a sharded collection. We should add support for sharded $near/$nearSphere, especially given future plans to mark the query the geoNear command as deprecated. One way to accomplish this would be to make use of the existing "geoNearDistance" $meta projection. In this design, the mongos query path would extend a $near query to project the "geoNearDistance" metadata as teh sort key. The query issued from mongos to the shards would look something like this:
The AsyncResultsMerger, which merges query results on mongos, already knows how to interpret $sortKey in order to do a merge-sort. |
| Comments |
| Comment by Githook User [ 28/Dec/17 ] |
|
Author: {'username': 'tessavitabile', 'email': 'tess.avitabile@mongodb.com', 'name': 'Tess Avitabile'}Message: |
| Comment by Eyllo [ 24/Mar/14 ] |
|
Hi there, So is this in 2.6.0 rc2 already? Because we aren't able to use Mongo sharded as we heavily rely on this feature. Thanks! |
| Comment by Mathias Stearn [ 27/Feb/12 ] |
|
geoNear already supports limit (called "num" Currently neither geoNear or $near support using cursors and must return all results within a single batch. |
| Comment by Nick Gerner [ 24/Feb/12 ] |
|
if we had this feature, would we have features like limit, skip and cursor support in geoNear? |