Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7241

should 2d indexes not be allowed to be unique?

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Geo
    • 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 }

      Attachments

        Activity

          People

            backlog-server-query Backlog - Query Team (Inactive)
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: