summaryrefslogtreecommitdiff
path: root/jstests/cqf/analyze_command.js
blob: 903cfd2ddf844d9f2f11a81e6c2df9dede4cf2a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
}());