Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
-
ALL
Description
$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 }
|
Attachments
Issue Links
- duplicates
-
SERVER-1981 Support $near and $nearSphere predicates on sharded collections
-
- Closed
-