jstests/core/doc_validation_encrypt_keywords.js
/**
 * Verify that the validator's in-memory state matches its on-disk state.
 */
Verify that the validator's in-memory state matches its on-disk state.
Verify that the validator ' s in - memory state matches its on - disk state .
function validateCollectionOptions() {
    function verifyValidateSuccess(output) {
        assert(output.hasOwnProperty("errors"), output);
        assert.eq(0, output["errors"].length, output);
        assert(output.hasOwnProperty("valid"), output);
        assert.eq(true, output["valid"], output);
    }
    const validateResult = assert.commandWorked(coll.validate({full: true}));
    if (validateResult.hasOwnProperty("raw")) {
        const rawOutput = validateResult["raw"];
        for (const key of Object.keys(rawOutput)) {
            verifyValidateSuccess(rawOutput[key]);
        }
    } else {
        verifyValidateSuccess(validateResult);
    }
}
function validateCollectionOptions ( ) { function verifyValidateSuccess ( output ) { assert ( output . hasOwnProperty ( "errors" ) , output ) ; assert . eq ( 0 , output [ "errors" ] . length , output ) ; assert ( output . hasOwnProperty ( "valid" ) , output ) ; assert . eq ( true , output [ "valid" ] , output ) ; } const validateResult = assert . commandWorked ( coll . validate ( { full : true } ) ) ; if ( validateResult . hasOwnProperty ( "raw" ) ) { const rawOutput = validateResult [ "raw" ] ; for ( const key of Object . keys ( rawOutput ) ) { verifyValidateSuccess ( rawOutput [ key ] ) ; } } else { verifyValidateSuccess ( validateResult ) ; } }
Verify that the validator's in-memory state matches its on-disk state.
Verify that the validator ' s in - memory state matches its on - disk state .