summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.cpp
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2017-08-15 18:31:33 -0400
committerMisha Tyulenev <misha@mongodb.com>2017-08-16 10:26:32 -0400
commit4520069d8584ffaa1439482b0a1ff8167d0812be (patch)
tree6f97bb45241641f76407438ed3aadbbdaf790e14 /src/mongo/db/commands.cpp
parentea31111dc95eb309269545348c34791b472f6c25 (diff)
downloadmongo-4520069d8584ffaa1439482b0a1ff8167d0812be.tar.gz
SERVER-29990 filterCommandRequestForPassthrough before sending to config server
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r--src/mongo/db/commands.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index c4e1ea6d2c1..5f5982d76f4 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -80,10 +80,10 @@ BSONObj Command::appendPassthroughFields(const BSONObj& cmdObjWithPassthroughFie
const BSONObj& request) {
BSONObjBuilder b;
b.appendElements(request);
- for (const auto& elem : cmdObjWithPassthroughFields) {
+ for (const auto& elem :
+ Command::filterCommandRequestForPassthrough(cmdObjWithPassthroughFields)) {
const auto name = elem.fieldNameStringData();
- // $db is one of the generic arguments, but is implicitly contained in request
- if (Command::isGenericArgument(name) && !request.hasField(name) && name != "$db") {
+ if (Command::isGenericArgument(name) && !request.hasField(name)) {
b.append(elem);
}
}