jstests/core/cover_null_queries.js
/**
 * Runs count command with the 'filter' and validates that the output returned matches
 * 'expectedOutput'. Also runs explain() command and validates that all the 'expectedStages'
 * are present in the plan returned.
 */
Runs count command with the 'filter' and validates that the output returned matches
'expectedOutput'. Also runs explain() command and validates that all the 'expectedStages'
are present in the plan returned.
Runs count command with the ' filter ' and validates that the output returned matches ' expectedOutput ' . Also runs explain () command and validates that all the ' expectedStages ' are present in the plan returned .
function validateSimpleCountCmdOutputAndPlan({filter, expectedStages, expectedCount}) {
    const cmdObj = {count: coll.getName(), query: filter};
    const res = assert.commandWorked(coll.runCommand(cmdObj));
    assert.eq(res.n, expectedCount);
    validateStages({cmdObj, expectedStages});
}
function validateSimpleCountCmdOutputAndPlan ( { filter , expectedStages , expectedCount } ) { const cmdObj = { count : coll . getName ( ) , query : filter } ; const res = assert . commandWorked ( coll . runCommand ( cmdObj ) ) ; assert . eq ( res . n , expectedCount ) ; validateStages ( { cmdObj , expectedStages } ) ; }
Runs count command with the 'filter' and validates that the output returned matches
 'expectedOutput'.
Runs count command with the ' filter ' and validates that the output returned matches ' expectedOutput ' .