[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:
Depends
Related
related to SERVER-3653 Issues with multiple spatial indexes Closed
is related to DOCS-1566 Geo index documentation does not expl... Closed
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:

  • Support multiple Geo indexes on a single collection
  • Allow the $geoNear command to specify which field to use for the query (in the same way that the $nearSphere command does

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 SERVER-3653

Generated at Thu Feb 08 03:21:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.