diff options
author | Misha Tyulenev <misha@mongodb.com> | 2017-08-15 18:31:33 -0400 |
---|---|---|
committer | Misha Tyulenev <misha@mongodb.com> | 2017-08-16 10:26:32 -0400 |
commit | 4520069d8584ffaa1439482b0a1ff8167d0812be (patch) | |
tree | 6f97bb45241641f76407438ed3aadbbdaf790e14 /src/mongo/db/commands.cpp | |
parent | ea31111dc95eb309269545348c34791b472f6c25 (diff) | |
download | mongo-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.cpp | 6 |
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); } } |