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

$maxDistance with 2dsphere index doesn't handle distances less than 10e-10

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.5
    • Affects Version/s: 2.4.8
    • Component/s: Geo
    • Environment:
    • ALL
    • Hide

      2.4.9-pre-

      > db.c.insert({loc:[0,0]})
      > db.c.ensureIndex({loc:"2dsphere"})
      > db.c.find({loc:{$nearSphere:[0,0],$maxDistance:10e-100}})
      >
      

      2.5.5-pre-

      > db.c.insert({loc:[0,0]})
      Insert WriteResult({ "ok" : 1, "n" : 1 })
      > db.c.ensureIndex({loc:"2dsphere"})
      > db.c.find({loc:{$nearSphere:[0,0],$maxDistance:10e-100}})
      { "_id" : ObjectId("52a264079ff3a7c681503c83"), "loc" : [ 0, 0 ] }
      
      Show
      2.4.9-pre- > db.c.insert({loc:[0,0]}) > db.c.ensureIndex({loc: "2dsphere" }) > db.c.find({loc:{$nearSphere:[0,0],$maxDistance:10e-100}}) > 2.5.5-pre- > db.c.insert({loc:[0,0]}) Insert WriteResult({ "ok" : 1, "n" : 1 }) > db.c.ensureIndex({loc: "2dsphere" }) > db.c.find({loc:{$nearSphere:[0,0],$maxDistance:10e-100}}) { "_id" : ObjectId( "52a264079ff3a7c681503c83" ), "loc" : [ 0, 0 ] }

          Assignee:
          Unassigned Unassigned
          Reporter:
          luke.lovett Luke Lovett
          Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

            Created:
            Updated:
            Resolved: