summaryrefslogtreecommitdiff
path: root/s
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-02-24 16:09:22 -0500
committerEliot Horowitz <eliot@10gen.com>2009-02-24 16:09:22 -0500
commit630e468d615843df4f829988e6ccb9bb4965e5d4 (patch)
treeee5dff987440cb16d706e660f0571c68e26f8efb /s
parent900a7f315f53459ade96c1e312594afc49fcda72 (diff)
downloadmongo-630e468d615843df4f829988e6ccb9bb4965e5d4.tar.gz
fix isMatchandOrder
Diffstat (limited to 's')
-rw-r--r--s/shardkey.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/s/shardkey.cpp b/s/shardkey.cpp
index 64977b09a2b..ee039800c65 100644
--- a/s/shardkey.cpp
+++ b/s/shardkey.cpp
@@ -123,6 +123,9 @@ namespace mongo {
if ( sort.nFields() != _fieldsAndOrder.nFields() )
return 0;
+ if ( ! sort.hasField( _fieldName.c_str() ) )
+ return 0;
+
if ( sort[_fieldName.c_str()].number() <= 0 )
return -1;
return 1;