Details
-
Improvement
-
Resolution: Won't Do
-
Major - P3
-
None
-
None
-
Query
Description
Uniqueness enforcement for 2d indexes seems to be constrained by the precision of the location information stored in the btree. (Two different locations with the same geo hash are not allowed in a unique index.) Does this mean we shouldn't allow geo indexes to be unique?
> c.drop()
|
true
|
> c.ensureIndex( { a:'2d' }, { unique:true } )
|
> c.save( { a:[ 0, 0 ] } )
|
> c.save( { a:[ 0, 0.00001 ] } )
|
> c.save( { a:[ 0, 0.000001 ] } )
|
E11000 duplicate key error index: test.c.$a_2d dup key: { : BinData }
|