jstests/libs/fixture_helpers.js
/**
     * Runs the command given by 'cmdObj' on the database given by 'db' on each shard nodes in
     * the fixture (besides the config servers). Asserts that each command works, and returns an
     * array with the responses from each shard, or with a single element if the fixture was a
     * replica set. If the fixture is a standalone, will run the command directly.
     */
Runs the command given by 'cmdObj' on the database given by 'db' on each shard nodes in
the fixture (besides the config servers). Asserts that each command works, and returns an
array with the responses from each shard, or with a single element if the fixture was a
replica set. If the fixture is a standalone, will run the command directly.
Runs the command given by ' cmdObj ' on the database given by ' db ' on each shard nodes in the fixture ( besides the config servers ) . Asserts that each command works and returns an array with the responses from each shard or with a single element if the fixture was a replica set . If the fixture is a standalone will run the command directly .
function runCommandOnAllShards({db, cmdObj, primaryNodeOnly}) {
        return mapOnEachShardNode({
            db,
            func: (primaryDb) => assert.commandWorked(primaryDb.runCommand(cmdObj)),
            primaryNodeOnly
        });
    }
function runCommandOnAllShards ( { db , cmdObj , primaryNodeOnly } ) { return mapOnEachShardNode ( { db , func : ( primaryDb ) => assert . commandWorked ( primaryDb . runCommand ( cmdObj ) ) , primaryNodeOnly } ) ; }
Runs the command given by 'cmdObj' on the database given by 'db' on each shard nodes in
 the fixture (besides the config servers).
Runs the command given by ' cmdObj ' on the database given by ' db ' on each shard nodes in the fixture ( besides the config servers ) .