jstests/libs/clustered_collections/clustered_collection_util.js
// values for fields absent in the user provided 'createOptions'.
values for fields absent in the user provided 'createOptions'.
values for fields absent in the user provided ' createOptions ' .
static constructFullCreateOptions(createOptions) {
        const fullCreateOptions = Object.extend({}, createOptions,  true);
        if (!createOptions.clusteredIndex.name) {
            const clusterKey = Object.keys(createOptions.clusteredIndex.key)[0];
            if (clusterKey == "_id") {
                fullCreateOptions.clusteredIndex.name = "_id_";
            } else {
                fullCreateOptions.clusteredIndex.name = clusterKey + "_1";
            }
        }
        if (!createOptions.clusteredIndex.v) {
            fullCreateOptions.clusteredIndex.v = 2;
        }
        return fullCreateOptions;
    }
static constructFullCreateOptions ( createOptions ) { const fullCreateOptions = Object . extend ( { } , createOptions , true ) ; if ( ! createOptions . clusteredIndex . name ) { const clusterKey = Object . keys ( createOptions . clusteredIndex . key ) [ 0 ] ; if ( clusterKey == "_id" ) { fullCreateOptions . clusteredIndex . name = "_id_" ; } else { fullCreateOptions . clusteredIndex . name = clusterKey + "_1" ; } } if ( ! createOptions . clusteredIndex . v ) { fullCreateOptions . clusteredIndex . v = 2 ; } return fullCreateOptions ; }
values for fields absent in the user provided 'createOptions'.
values for fields absent in the user provided ' createOptions ' .
/* deep copy */ // If the createOptions don't specify the name, expect the default. // If the createOptions don't specify 'v', expect the default.