summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_request.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-01-18 11:44:39 -0500
committerMathias Stearn <mathias@10gen.com>2017-01-18 11:44:39 -0500
commitdf60eec6052c7a7bcd71d1af31fc4a6f11c4699f (patch)
treeda6476a278a45c77835c7ae756e3ced0e603928a /src/mongo/db/query/query_request.cpp
parent4b35e713718e1d0f44dae516726b173c150efcef (diff)
downloadmongo-df60eec6052c7a7bcd71d1af31fc4a6f11c4699f.tar.gz
Revert "SERVER-27438 Prevent mongos from dropping legacy $comment meta-operator"
This reverts commit 0eeb9396ff46269c2181e5d4aeab629863d875d4.
Diffstat (limited to 'src/mongo/db/query/query_request.cpp')
-rw-r--r--src/mongo/db/query/query_request.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/mongo/db/query/query_request.cpp b/src/mongo/db/query/query_request.cpp
index b0f1334de8d..821282f78eb 100644
--- a/src/mongo/db/query/query_request.cpp
+++ b/src/mongo/db/query/query_request.cpp
@@ -37,7 +37,6 @@
#include "mongo/db/dbmessage.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/repl/read_concern_args.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/mongoutils/str.h"
@@ -114,7 +113,7 @@ QueryRequest::QueryRequest(NamespaceString nss) : _nss(std::move(nss)) {}
StatusWith<unique_ptr<QueryRequest>> QueryRequest::makeFromFindCommand(NamespaceString nss,
const BSONObj& cmdObj,
bool isExplain) {
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ unique_ptr<QueryRequest> qr(new QueryRequest(std::move(nss)));
qr->_explain = isExplain;
// Parse the command BSON by looping through one element at a time.
@@ -703,7 +702,7 @@ bool QueryRequest::isQueryIsolated(const BSONObj& query) {
// static
StatusWith<unique_ptr<QueryRequest>> QueryRequest::fromLegacyQueryMessage(const QueryMessage& qm) {
- auto qr = stdx::make_unique<QueryRequest>(NamespaceString(qm.ns));
+ unique_ptr<QueryRequest> qr(new QueryRequest(NamespaceString(qm.ns)));
Status status = qr->init(qm.ntoskip, qm.ntoreturn, qm.queryOptions, qm.query, qm.fields, true);
if (!status.isOK()) {
@@ -713,22 +712,6 @@ StatusWith<unique_ptr<QueryRequest>> QueryRequest::fromLegacyQueryMessage(const
return std::move(qr);
}
-StatusWith<unique_ptr<QueryRequest>> QueryRequest::fromLegacyQueryForTest(NamespaceString nss,
- const BSONObj& queryObj,
- const BSONObj& proj,
- int ntoskip,
- int ntoreturn,
- int queryOptions) {
- auto qr = stdx::make_unique<QueryRequest>(nss);
-
- Status status = qr->init(ntoskip, ntoreturn, queryOptions, queryObj, proj, true);
- if (!status.isOK()) {
- return status;
- }
-
- return std::move(qr);
-}
-
Status QueryRequest::init(int ntoskip,
int ntoreturn,
int queryOptions,
@@ -879,13 +862,6 @@ Status QueryRequest::initFullQuery(const BSONObj& top) {
return maxTimeMS.getStatus();
}
_maxTimeMS = maxTimeMS.getValue();
- } else if (str::equals("comment", name)) {
- // Legacy $comment can be any BSON element. Convert to string if it isn't already.
- if (e.type() == BSONType::String) {
- _comment = e.str();
- } else {
- _comment = e.toString(false);
- }
}
}
}