diff options
author | Lynne Wang <lynne.wang@mongodb.com> | 2022-07-06 22:07:06 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-06 22:39:07 +0000 |
commit | e8db2d2a5f4f3a61484c576eef00f39f9feb5d73 (patch) | |
tree | 7ce7d3cc87486307d73e464641785201bd1d52cc /jstests/cqf | |
parent | ca7aaa4d46e1d50b8119e8800d5a7434295a6baa (diff) | |
download | mongo-e8db2d2a5f4f3a61484c576eef00f39f9feb5d73.tar.gz |
SERVER-66604 Analyze command skeleton
Diffstat (limited to 'jstests/cqf')
-rw-r--r-- | jstests/cqf/analyze_command.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/jstests/cqf/analyze_command.js b/jstests/cqf/analyze_command.js new file mode 100644 index 00000000000..903cfd2ddf8 --- /dev/null +++ b/jstests/cqf/analyze_command.js @@ -0,0 +1,23 @@ +(function() { +"use strict"; + +load("jstests/libs/optimizer_utils.js"); // For checkCascadesOptimizerEnabled. +if (!checkCascadesOptimizerEnabled(db)) { + jsTestLog("Skipping test because the optimizer is not enabled"); + return; +} + +const coll = db.cqf_analyze; +coll.drop(); + +assert.commandWorked(coll.insert({a: [1, 2, 4, 4, 5, 6]})); + +let res = db.runCommand({analyze: coll.getName()}); +assert.commandFailedWithCode(res, ErrorCodes.NotImplemented); + +res = db.runCommand({analyze: coll.getName(), apiVersion: "1", apiStrict: true}); +assert.commandFailedWithCode(res, ErrorCodes.APIStrictError); + +res = db.runCommand({analyze: coll.getName(), writeConcern: {w: 1}}); +assert.commandFailedWithCode(res, ErrorCodes.NotImplemented); +}()); |