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

geospatial box query doesn't find center point

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.5
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • None
    • Environment:
      db version v1.3.5-, pdfile version 4.5
      git version: b14d45ae5575fbdc7042c4798a63bd77d50ec92e

      I'm creating a 9x9 grid from [1,1]-[9,9], then I'm querying for the box [[4,4],[6,6]] and it's not finding the (5,5) point.

      > db.geo.drop()
      true
      > db.geo.ensureIndex(

      {"loc" : "2d"}

      ,

      {"min" : 0, "max" : 10}

      )
      > for (i=1; i<10; i+) { for(j=1; j<10; j+) { db.geo.insert(

      {loc : [i,j]}

      ); } }
      > db.geo.find({loc : {$within : {$box : [[4,4],[6,6]]}}})
      > db.geo.find(

      {loc : [5,5]}

      )

      { "_id" : ObjectId("4ba3912921c2dc6b59b9684f"), "loc" : [ 5, 5 ] }

      >

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            kristina Kristina Chodorow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: