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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 (Inactive)
              Reporter:
              Florian Odronitz
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: