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

$within-query for geo location does not return all matches

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.4
    • Affects Version/s: 1.4.3, 1.5.2
    • Component/s: Geo
    • None
    • Environment:
      OS X 10.6.3
    • ALL

      When querying documents using $within, in some situations some results are omitted:

      Here is a test case:
      > db.pos.remove()
      > db.pos.save(

      { loc: [ 5000000, 900000 ], id: 1}

      )
      > db.pos.save(

      { loc: [ 5000000, 900000 ], id: 2}

      )
      > db.pos.ensureIndex(

      { loc : "2d" }

      ,

      { min : -21000000 , max : 21000000 }

      )
      > db.pos.save(

      { loc: [ 5000000, 900000 ], id: 3}

      )
      > db.pos.save(

      { loc: [ 5000000, 900000 ], id: 4}

      )
      > db.pos.find({"loc" : {"$within" :

      {"$center" : [[5000000, 900000], 1.0]}

      }}).count()
      4
      > db.pos.find({"loc" : {"$within" :

      {"$center" : [[5000001, 900000], 5.0]}

      }}).count()
      1
      > db.pos.find({"loc" : {"$within" :

      {"$center" : [[5000001, 900000], 5.0]}

      }}).toArray();
      [

      { "_id" : ObjectId("4c173306f5d9d34a46cb7b11"), "loc" : [ 5000000, 900000 ], "id" : 4 }

      ]

            Assignee:
            richard.kreuter Richard Kreuter (Inactive)
            Reporter:
            odo Florian Odronitz
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: