0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

Support $within on sharded collections SERVER-926

This commit is contained in:
Mathias Stearn 2010-10-18 18:21:05 -04:00
parent 39d768653e
commit 04a889eb05

View File

@ -804,7 +804,19 @@ namespace mongo {
//TODO look into FieldRangeSetOr
FieldRangeOrSet fros(_ns.c_str(), query, false);
uassert(13088, "no support for special queries yet", fros.getSpecial().empty());
const string special = fros.getSpecial();
if (special == "2d") {
BSONForEach(field, query){
if (getGtLtOp(field) == BSONObj::opNEAR) {
uassert(13501, "use geoNear command rather than $near query", false);
// TODO: convert to geoNear rather than erroring out
}
// $within queries are fine
}
} else if (!special.empty()){
uassert(13502, "unrecognized special query type: " + special, false);
}
do {
boost::scoped_ptr<FieldRangeSet> frs (fros.topFrs());