jstests/core/api_version_test_expression.js
// Test that API version parameters are inherited into the inner command of the explain command.
Test that API version parameters are inherited into the inner command of the explain command.
Test that API version parameters are inherited into the inner command of the explain command .
function checkExplainInnerCommandGetsAPIVersionParameters(explainedCmd, errCode) {
    assert.commandFailedWithCode(
        db.runCommand(
            {explain: explainedCmd, apiVersion: "1", apiDeprecationErrors: true, apiStrict: true}),
        errCode);
    const explainRes = db.runCommand({explain: explainedCmd, apiVersion: "1", apiStrict: false});
    assert(explainRes.hasOwnProperty('executionStats'), explainRes);
    assert.eq(explainRes['executionStats']['executionSuccess'], true, explainRes);
}
function checkExplainInnerCommandGetsAPIVersionParameters ( explainedCmd , errCode ) { assert . commandFailedWithCode ( db . runCommand ( { explain : explainedCmd , apiVersion : "1" , apiDeprecationErrors : true , apiStrict : true } ) , errCode ) ; const explainRes = db . runCommand ( { explain : explainedCmd , apiVersion : "1" , apiStrict : false } ) ; assert ( explainRes . hasOwnProperty ( 'executionStats' ) , explainRes ) ; assert . eq ( explainRes [ 'executionStats' ] [ 'executionSuccess' ] , true , explainRes ) ; }
Test that API version parameters are inherited into the inner command of the explain command.
Test that API version parameters are inherited into the inner command of the explain command .
// If 'apiStrict: false' the inner aggregate command will execute successfully.