diff options
author | Greg Studer <greg@10gen.com> | 2013-05-15 09:50:08 -0400 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2013-05-15 09:50:27 -0400 |
commit | f965235efa02833d8055013525ff0433567e0d95 (patch) | |
tree | adb71f539f1f2aba266e58b562126d0f255190cd /src/mongo/db/index/s2_access_method.cpp | |
parent | f1f5a9538290d0a9e1831da34b70016a2774b40b (diff) | |
download | mongo-f965235efa02833d8055013525ff0433567e0d95.tar.gz |
SERVER-9647 don't transform 2dsphere desc fields into asc
Diffstat (limited to 'src/mongo/db/index/s2_access_method.cpp')
-rw-r--r-- | src/mongo/db/index/s2_access_method.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/index/s2_access_method.cpp b/src/mongo/db/index/s2_access_method.cpp index ca4fc60d2c8..c43ecc75964 100644 --- a/src/mongo/db/index/s2_access_method.cpp +++ b/src/mongo/db/index/s2_access_method.cpp @@ -73,13 +73,20 @@ namespace mongo { _params.finestIndexedLevel >= _params.coarsestIndexedLevel); int geoFields = 0; + // Categorize the fields we're indexing and make sure we have a geo field. BSONObjIterator i(descriptor->keyPattern()); while (i.more()) { BSONElement e = i.next(); - if (e.type() == String && IndexNames::GEO_2DSPHERE == e.valuestr()) { + if (e.type() == String && IndexNames::GEO_2DSPHERE == e.String() ) { ++geoFields; } + else { + // We check for numeric in 2d, so that's the check here + uassert( 16823, (string)"Cannot use " + IndexNames::GEO_2DSPHERE + + " index with other special index types: " + e.toString(), + e.isNumber() ); + } } uassert(16750, "Expect at least one geo field, spec=" + descriptor->keyPattern().toString(), geoFields >= 1); |