jstests/sharding/unowned_doc_filtering.js
/*
 * Asserts that find and count command filter out unowned documents.
 */
Asserts that find and count command filter out unowned documents.
Asserts that find and count command filter out unowned documents .
function assertOrphanedDocsFiltered(coll, ownedDocs, unownedDocs, countFilters) {
    assert.eq(ownedDocs.length, coll.find().itcount());
    for (let doc of unownedDocs) {
        assert.eq(0, coll.find(doc).itcount());
        assert.eq(0, coll.count(doc));
    }
    for (let {filter, count} of countFilters) {
        assert.eq(count, coll.find(filter).itcount());
        assert.eq(count, coll.count(filter));
    }
}
function assertOrphanedDocsFiltered ( coll , ownedDocs , unownedDocs , countFilters ) { assert . eq ( ownedDocs . length , coll . find ( ) . itcount ( ) ) ; for ( let doc of unownedDocs ) { assert . eq ( 0 , coll . find ( doc ) . itcount ( ) ) ; assert . eq ( 0 , coll . count ( doc ) ) ; } for ( let { filter , count } of countFilters ) { assert . eq ( count , coll . find ( filter ) . itcount ( ) ) ; assert . eq ( count , coll . count ( filter ) ) ; } }
Asserts that find and count command filter out unowned documents.
Asserts that find and count command filter out unowned documents .