jstests/sharding/internal_txns/retryable_writes_retry_in_different_batches.js
/*
 * Returns a new command object created from 'cmdObj' and the session/transaction fields defined in
 * 'sessionOpts'.
 */
Returns a new command object created from 'cmdObj' and the session/transaction fields defined in
'sessionOpts'.
Returns a new command object created from ' cmdObj ' and the session / transaction fields defined in ' sessionOpts ' .
function makeCmdObjWithTxnFields(cmdObj, sessionOpts) {
    const cmdObjWithTxnFields = Object.assign({}, cmdObj);
    cmdObjWithTxnFields.lsid = sessionOpts.lsid;
    cmdObjWithTxnFields.txnNumber = sessionOpts.txnNumber;
    if (sessionOpts.isTransaction) {
        cmdObjWithTxnFields.autocommit = false;
    }
    return cmdObjWithTxnFields;
}
function makeCmdObjWithTxnFields ( cmdObj , sessionOpts ) { const cmdObjWithTxnFields = Object . assign ( { } , cmdObj ) ; cmdObjWithTxnFields . lsid = sessionOpts . lsid ; cmdObjWithTxnFields . txnNumber = sessionOpts . txnNumber ; if ( sessionOpts . isTransaction ) { cmdObjWithTxnFields . autocommit = false ; } return cmdObjWithTxnFields ; }
Returns a new command object created from 'cmdObj' and the session/transaction fields defined in
 'sessionOpts'.
Returns a new command object created from ' cmdObj ' and the session / transaction fields defined in ' sessionOpts ' .