summaryrefslogtreecommitdiff
path: root/src/mongo/scripting
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2020-02-20 16:12:08 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-26 15:25:40 +0000
commitdbc00195a18a3aecbcb7b254c3de2056fe25aa24 (patch)
treee736aa635918774eac5dcfa759ab7319f88fb1f9 /src/mongo/scripting
parent687f9be7fa79ac6f3c2025784f942fdcafeb2a5f (diff)
downloadmongo-dbc00195a18a3aecbcb7b254c3de2056fe25aa24.tar.gz
SERVER-45460 Mark CodeWithScope as deprecated in bsontypes.h
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r--src/mongo/scripting/engine.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp
index 754a14067db..14a75d6b959 100644
--- a/src/mongo/scripting/engine.cpp
+++ b/src/mongo/scripting/engine.cpp
@@ -239,8 +239,15 @@ void Scope::loadStored(OperationContext* opCtx, bool ignoreNotConnected) {
BSONElement n = o["_id"];
BSONElement v = o["value"];
- uassert(10209, str::stream() << "name has to be a string: " << n, n.type() == String);
- uassert(10210, "value has to be set", v.type() != EOO);
+ uassert(
+ 10209, str::stream() << "name has to be a string: " << n, n.type() == BSONType::String);
+ uassert(10210, "value has to be set", v.type() != BSONType::EOO);
+
+ uassert(4546000,
+ str::stream() << "BSON type 'CodeWithScope' not supported in system.js scripts. As "
+ "an alternative use 'Code'. Script _id value: '"
+ << n.String() << "'",
+ v.type() != BSONType::CodeWScope);
if (MONGO_unlikely(mr_killop_test_fp.shouldFail())) {