diff options
author | David Bartley <andareed@gmail.com> | 2018-02-12 23:28:05 -0800 |
---|---|---|
committer | Bernard Gorman <bernard.gorman@gmail.com> | 2018-03-15 17:33:28 +0000 |
commit | e4f1475e9cdf8da3958c14a92b9362e1ce3520af (patch) | |
tree | 0d291d3ff68e2cb3f3912691806512ced0f67758 /src/mongo/db/curop.cpp | |
parent | 2e73e59be2497e5ee054b7cb9eea5e362ad82e69 (diff) | |
download | mongo-e4f1475e9cdf8da3958c14a92b9362e1ce3520af.tar.gz |
SERVER-33154 Legacy queries with predicate {query: "foo"} are upconverted incorrectly
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r-- | src/mongo/db/curop.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index a000d63a898..ea71baacde0 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -84,12 +84,12 @@ BSONObj upconvertQueryEntry(const BSONObj& query, // Extract the query predicate. BSONObj filter; - if (auto elem = query["query"]) { + if (query["query"].isABSONObj()) { predicateIsWrapped = true; - bob.appendAs(elem, "filter"); - } else if (auto elem = query["$query"]) { + bob.appendAs(query["query"], "filter"); + } else if (query["$query"].isABSONObj()) { predicateIsWrapped = true; - bob.appendAs(elem, "filter"); + bob.appendAs(query["$query"], "filter"); } else if (!query.isEmpty()) { bob.append("filter", query); } |