jstests/core/arrayfind8.js
/**
 * Check that the query results match the documents in the 'expected' array.
 */
Check that the query results match the documents in the 'expected' array.
Check that the query results match the documents in the ' expected ' array .
function assertResults(expected, query, context) {
    assert.eq(expected.length, coll.count(query), 'unexpected count in ' + context);
    const results = coll.find(query).toArray();
    const resultsAOnly = results.map((r) => r.a);
    assert.sameMembers(resultsAOnly, expected);
}
function assertResults ( expected , query , context ) { assert . eq ( expected . length , coll . count ( query ) , 'unexpected count in ' + context ) ; const results = coll . find ( query ) . toArray ( ) ; const resultsAOnly = results . map ( ( r ) => r . a ) ; assert . sameMembers ( resultsAOnly , expected ) ; }
Check that the query results match the documents in the 'expected' array.
Check that the query results match the documents in the ' expected ' array .