jstests/core/drop_index.js
/**
 * Checks that collection contains the given list of non-id indexes and nothing else.
 */
Checks that collection contains the given list of non-id indexes and nothing else.
Checks that collection contains the given list of non - id indexes and nothing else .
function assertIndexes(expectedIndexNames, msg) {
    const actualIndexNames = getIndexNames();
    const testMsgSuffix = () => msg + ': expected ' + tojson(expectedIndexNames) + ' but got ' +
        tojson(actualIndexNames) + ' instead.';
    assert.eq(expectedIndexNames.length + 1,
              actualIndexNames.length,
              'unexpected number of indexes after ' + testMsgSuffix());
    assert(actualIndexNames.includes('_id_'),
           '_id index missing after ' + msg + ': ' + tojson(actualIndexNames));
    for (let expectedIndexName of expectedIndexNames) {
        assert(actualIndexNames.includes(expectedIndexName),
               expectedIndexName + ' index missing after ' + testMsgSuffix());
    }
}
function assertIndexes ( expectedIndexNames , msg ) { const actualIndexNames = getIndexNames ( ) ; const testMsgSuffix = ( ) => msg + ': expected ' + tojson ( expectedIndexNames ) + ' but got ' + tojson ( actualIndexNames ) + ' instead.' ; assert . eq ( expectedIndexNames . length + 1 , actualIndexNames . length , 'unexpected number of indexes after ' + testMsgSuffix ( ) ) ; assert ( actualIndexNames . includes ( '_id_' ) , '_id index missing after ' + msg + ': ' + tojson ( actualIndexNames ) ) ; for ( let expectedIndexName of expectedIndexNames ) { assert ( actualIndexNames . includes ( expectedIndexName ) , expectedIndexName + ' index missing after ' + testMsgSuffix ( ) ) ; } }
Checks that collection contains the given list of non-id indexes and nothing else.
Checks that collection contains the given list of non - id indexes and nothing else .