summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Kleinman <samk@10gen.com>2015-03-30 19:04:57 -0400
committerRamon Fernandez <ramon.fernandez@mongodb.com>2015-04-17 11:28:05 -0400
commit150d03405122fbb7ffe20a0d99d12199fa3bcb42 (patch)
treefb4130e52cd6e310da79a4c85d2176c3f85c63b9
parent003520d8d6190beedb7a7a2a1d2b77ef7a974adf (diff)
downloadmongo-150d03405122fbb7ffe20a0d99d12199fa3bcb42.tar.gz
SERVER-17749: ignore fields starting with $ in collMod command, to match behavior of aggregation pipeline command.
(cherry picked from commit aa51ce621c39c54c2105eebe2f0961f0dc9c2890)
-rw-r--r--src/mongo/db/dbcommands.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index c64e55c43e5..9d5b9d027c5 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -1135,6 +1135,9 @@ namespace mongo {
if ( str::equals( "collMod", e.fieldName() ) ) {
// no-op
}
+ else if ( str::startsWith( e.fieldName(), "$" ) ) {
+ // no-op: ignore top-level fields prefixed with $. They are for the command processor.
+ }
else if ( LiteParsedQuery::cmdOptionMaxTimeMS == e.fieldNameStringData() ) {
// no-op
}