summaryrefslogtreecommitdiff
path: root/jstests/core/json_schema/json_schema.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/json_schema/json_schema.js')
-rw-r--r--jstests/core/json_schema/json_schema.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/jstests/core/json_schema/json_schema.js b/jstests/core/json_schema/json_schema.js
index 45828fdcca8..7c73c1d5e75 100644
--- a/jstests/core/json_schema/json_schema.js
+++ b/jstests/core/json_schema/json_schema.js
@@ -2,7 +2,6 @@
// @tags: [
// assumes_no_implicit_collection_creation_after_drop,
// requires_non_retryable_commands,
-// sbe_incompatible,
// ]
/**
@@ -13,6 +12,14 @@
load("jstests/libs/assert_schema_match.js");
+// Note that the "getParameter" command is expected to fail in versions of mongod that do not yet
+// include the slot-based execution engine. When that happens, however, 'isSBEEnabled' still
+// correctly evaluates to false.
+const isSBEEnabled = (() => {
+ const getParam = db.adminCommand({getParameter: 1, featureFlagSBE: 1});
+ return getParam.hasOwnProperty("featureFlagSBE") && getParam.featureFlagSBE.value;
+})();
+
let coll = db.jstests_json_schema;
coll.drop();
@@ -336,8 +343,10 @@ assert.eq(
assert.eq(1, coll.find({$or: [{$jsonSchema: {}, a: 1}, {b: 1}]}).itcount());
assert.eq(1, coll.find({$and: [{$jsonSchema: {}, a: 1}, {b: 1}]}).itcount());
-assert.eq(1, coll.find({$_internalSchemaMinProperties: 3, b: 2}).itcount());
-assert.eq(1, coll.find({$_internalSchemaMaxProperties: 3, b: 2}).itcount());
+if (!isSBEEnabled) {
+ assert.eq(1, coll.find({$_internalSchemaMinProperties: 3, b: 2}).itcount());
+ assert.eq(1, coll.find({$_internalSchemaMaxProperties: 3, b: 2}).itcount());
+}
assert.eq(1, coll.find({$alwaysTrue: 1, b: 2}).itcount());
assert.eq(0, coll.find({$alwaysFalse: 1, b: 2}).itcount());
}());