should 2d indexes not be allowed to be unique?

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Geo
    • Query
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 }
      

            Assignee:
            Backlog - Query Team (Inactive)
            Reporter:
            Aaron Staple (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: