|
alonho, can you show me where this is failing? I wrote a quick test for this and it seems to work fine.
To run the test, copy this sample to a file (shard_test.js) and run: mongo --nodb shard_test.js
var st = new ShardingTest({ shards: 2, chunkSize: 1, nopreallocj: 1 });
|
var testDB = st.s.getDB('test');
|
testDB.adminCommand({ enableSharding: 'test' });
|
testDB.adminCommand({ shardCollection: 'test.geoShard', key: { x: 1 }});
|
var col = testDB.geoShard;
|
col.ensureIndex({loc: "2dsphere"})
|
|
var p = [-71.34895, 42.46037];
|
var q = [1.48736, 42.55327];
|
col.save({x: 1, loc: p});
|
col.save({x: 2, loc: q});
|
|
assert.eq(2, col.find({$or: [{loc: {$geoWithin: {$centerSphere: [p, 10]}}},
|
{loc: {$geoWithin: {$centerSphere: [p, 10]}}}]}).itcount());
|
|