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

geoNear cmd + uniquedocs = fuzzier results

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.6.0-rc0
    • None
    • Geo
    • None
    • ALL
    • Hide

      collName = 'geo_uniqueDocs_test'
      t = db.geo_uniqueDocs_test
      t.drop()

      t.save(

      { locs : [ [0,2], [3,4]] }

      )
      t.save(

      { locs : [ [6,8], [10,10] ] }

      )

      t.ensureIndex(

      { locs : '2d' }

      )

      results = db.runCommand(

      {geoNear:collName, near:[0,0], num:2, uniqueDocs:false}

      ).results
      printjson(results);

      results = db.runCommand(

      {geoNear:collName, near:[0,0], num:2, uniqueDocs:true}

      ).results
      printjson(results);

      Show
      collName = 'geo_uniqueDocs_test' t = db.geo_uniqueDocs_test t.drop() t.save( { locs : [ [0,2], [3,4]] } ) t.save( { locs : [ [6,8], [10,10] ] } ) t.ensureIndex( { locs : '2d' } ) results = db.runCommand( {geoNear:collName, near:[0,0], num:2, uniqueDocs:false} ).results printjson(results); results = db.runCommand( {geoNear:collName, near:[0,0], num:2, uniqueDocs:true} ).results printjson(results);

    Attachments

      Activity

        People

          hari.khalsa@10gen.com hari.khalsa@10gen.com
          hari.khalsa@10gen.com hari.khalsa@10gen.com
          Votes:
          0 Vote for this issue
          Watchers:
          4 Start watching this issue

          Dates

            Created:
            Updated:
            Resolved: