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

$geoNear operator does not work in sharded cluster

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • ALL

      $geoNear works fine on standalone instances, but not does not seem to work in a sharded cluster.

      The following was run against a build from 1/16

      mongos> sh.addShard("localhost:27017")
      { "shardAdded" : "shard0000", "ok" : 1 }
      mongos> sh.enableSharding("test")
      { "ok" : 1 }
      mongos> sh.shardCollection("test.test", {_id:1})
      { "collectionsharded" : "test.test", "ok" : 1 }
      mongos> use test
      switched to db test
      mongos> db.test.find()
      { "_id" : 0, "loc" : [  0,  0 ] }
      mongos> db.test.ensureIndex({loc: "2d"})
      mongos> db.test.find()
      { "_id" : 0, "loc" : [  0,  0 ] }
      mongos> db.test.find({loc: {$geoNear: [0,0]}})
      error: { "$err" : "use geoNear command rather than $near query", "code" : 13501 }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            andrew.emil@10gen.com Andrew Emil (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: