[SERVER-9842] Inconsistent and undocumented behavior of Geo indexes and Geo queries Created: 31/May/13 Updated: 10/Dec/14 Resolved: 27/Feb/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Geo |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | William Zola | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
The behavior of Geo indexes is inconsistent and is not enforced by the code. The ensureIndex() command will let you create multiple 2d and 2dsphere indexes on a collection. If you query the collection with $geoNear, it will error out if there are multiple 2d indexes, and will silently ignore the 2dsphere index if there is both a 2d and a 2dsphere index If you query a collection with $nearSphere, you can use a collection with multiple 2d indexes; the index selected for the query depends on the query field specified in $nearSphere. This should be made (at the least) consistent; ideally MongoDB should:
If MongoDB is going to have a limit of one Geo index per collection, it should enforce that limit when ensureIndex() is called, and not when the collection is queried. EDIT: Radically revised problem description |
| Comments |
| Comment by Daniel Pasette (Inactive) [ 27/Feb/14 ] |
|
duplicate of |