summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/mr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/mr.cpp')
-rw-r--r--src/mongo/db/commands/mr.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index 74ec1dbfdbe..244acfbd221 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -72,6 +72,7 @@
#include "mongo/s/stale_exception.h"
#include "mongo/scripting/engine.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/util/debug_util.h"
#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
#include "mongo/util/str.h"
@@ -92,6 +93,8 @@ namespace dps = ::mongo::dotted_path_support;
namespace mr {
namespace {
+Rarely mapParamsDeprecationSampler; // Used to occasionally log deprecation messages.
+
/**
* Runs a count against the namespace specified by 'ns'. If the caller holds the global write lock,
* then this function does not acquire any additional locks.
@@ -456,8 +459,14 @@ Config::Config(const string& _dbname, const BSONObj& cmdObj) {
if (cmdObj["finalize"].type() && cmdObj["finalize"].trueValue())
finalizer.reset(new JSFinalizer(cmdObj["finalize"]));
- if (cmdObj["mapparams"].type() == Array) {
- mapParams = cmdObj["mapparams"].embeddedObjectUserCheck().getOwned();
+ // DEPRECATED
+ if (auto mapParamsElem = cmdObj["mapparams"]) {
+ if (mapParamsDeprecationSampler.tick()) {
+ warning() << "The mapparams option to MapReduce is deprecated.";
+ }
+ if (mapParamsElem.type() == Array) {
+ mapParams = mapParamsElem.embeddedObjectUserCheck().getOwned();
+ }
}
}