jstests/sharding/refine_collection_shard_key_basic.js
// Assumes the given arrays are sorted by the max field.
Assumes the given arrays are sorted by the max field.
Assumes the given arrays are sorted by the max field .
function compareMinAndMaxFields(shardedArr, refinedArr) {
    assert(shardedArr.length && refinedArr.length, tojson(shardedArr) + ", " + tojson(refinedArr));
    assert.eq(shardedArr.length, refinedArr.length, tojson(shardedArr) + ", " + tojson(refinedArr));
    const shardedMinAndMax = shardedArr.map(obj => {
        return {min: obj.min, max: obj.max};
    });
    const refinedMinAndMax = refinedArr.map(obj => {
        return {min: obj.min, max: obj.max};
    });
    assert.eq(shardedMinAndMax, refinedMinAndMax);
}
function compareMinAndMaxFields ( shardedArr , refinedArr ) { assert ( shardedArr . length && refinedArr . length , tojson ( shardedArr ) + ", " + tojson ( refinedArr ) ) ; assert . eq ( shardedArr . length , refinedArr . length , tojson ( shardedArr ) + ", " + tojson ( refinedArr ) ) ; const shardedMinAndMax = shardedArr . map ( obj => { return { min : obj . min , max : obj . max } ; } ) ; const refinedMinAndMax = refinedArr . map ( obj => { return { min : obj . min , max : obj . max } ; } ) ; assert . eq ( shardedMinAndMax , refinedMinAndMax ) ; }
Assumes the given arrays are sorted by the max field.
Assumes the given arrays are sorted by the max field .