diff options
author | David Storch <david.storch@10gen.com> | 2014-10-07 18:23:21 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2014-10-13 19:59:21 -0400 |
commit | d601b91b6b16be3f93bac2f10952c1e5d273f91f (patch) | |
tree | f8b7daf9d3920ded5567489d0d65df50afed9542 /src/mongo/db/query | |
parent | e7a49e50e5a858b02c9c242c943d7559238bb2b6 (diff) | |
download | mongo-d601b91b6b16be3f93bac2f10952c1e5d273f91f.tar.gz |
SERVER-14875 explain helpers for the shell
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r-- | src/mongo/db/query/lite_parsed_query.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/query/lite_parsed_query_test.cpp | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/query/lite_parsed_query.cpp b/src/mongo/db/query/lite_parsed_query.cpp index fe9c4383a3a..67019db5504 100644 --- a/src/mongo/db/query/lite_parsed_query.cpp +++ b/src/mongo/db/query/lite_parsed_query.cpp @@ -176,7 +176,7 @@ namespace mongo { return status; } - pq->_wantMore = el.boolean(); + pq->_wantMore = !el.boolean(); } else if (mongoutils::str::equals(fieldName, "options")) { Status status = checkFieldType(el, Object); @@ -189,6 +189,9 @@ namespace mongo { return parseStatus; } } + else if (mongoutils::str::equals(fieldName, "$readPreference")) { + pq->_options.hasReadPref = true; + } else { mongoutils::str::stream ss; ss << "Failed to parse: " << cmdObj.toString() << ". " diff --git a/src/mongo/db/query/lite_parsed_query_test.cpp b/src/mongo/db/query/lite_parsed_query_test.cpp index db77954c551..aceea8c9933 100644 --- a/src/mongo/db/query/lite_parsed_query_test.cpp +++ b/src/mongo/db/query/lite_parsed_query_test.cpp @@ -404,7 +404,7 @@ namespace { ASSERT_EQUALS(3, lpq->getLimit()); ASSERT_EQUALS(5, lpq->getSkip()); ASSERT_EQUALS(90, lpq->getBatchSize()); - ASSERT(!lpq->wantMore()); + ASSERT(lpq->wantMore()); } // |