[SERVER-18004] Support $or between geo queries in the mongos Created: 13/Apr/15  Updated: 22/Apr/15  Resolved: 22/Apr/15

Status: Closed
Project: Core Server
Component/s: Geo, Querying, Sharding
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Alon Horev Assignee: Siyuan Zhou
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File test.log    
Issue Links:
Duplicate
duplicates SERVER-13656 Use new query framework in getShardsF... Closed
Related
related to SERVER-3984 Support $or and geo queries Closed
Participants:

 Description   

This was solved in the mongod in SERVER-3984. I can't see why not support at in the mongos.
It's easy to reproduce: invoke a $or with two geoWithin on a sharded collection and you'll get: database error: '$or may not contain 'special' query'.



 Comments   
Comment by Siyuan Zhou [ 22/Apr/15 ]

Yes. This is fixed by SERVER-13656, when we started to use new query framework to target a query on mongos in 2.7.0, so upgrading to 3.0 will solve this problem.

Closing this ticket as duplication of SERVER-13656.

Comment by Daniel Pasette (Inactive) [ 19/Apr/15 ]

Apparently this was fixed during the sizable code refactor done to the geo sub-system before 3.0 as this test is working against master and 3.0.2. Assigning to siyuan.zhou@10gen.com to verify it is fixed and identify when it happened if possible.

Comment by Alon Horev [ 18/Apr/15 ]

I ran the test on 2.6 and it failed. Attaching the log.

Comment by Daniel Pasette (Inactive) [ 16/Apr/15 ]

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());

Generated at Thu Feb 08 03:46:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.