src/mongo/shell/replsettest.js
/**
     * Returns the OpTime for the specified host by issuing replSetGetStatus.
     */
Returns the OpTime for the specified host by issuing replSetGetStatus.
Returns the OpTime for the specified host by issuing replSetGetStatus .
function _getLastOpTime(conn) {
        var replSetStatus = asCluster(
            conn,
            () => assert.commandWorked(conn.getDB("admin").runCommand({replSetGetStatus: 1})));
        var connStatus = replSetStatus.members.filter(m => m.self)[0];
        var opTime = connStatus.optime;
        if (_isEmptyOpTime(opTime)) {
            throw new Error("last OpTime is empty -- connection: " + conn);
        }
        return opTime;
    }
function _getLastOpTime ( conn ) { var replSetStatus = asCluster ( conn , ( ) => assert . commandWorked ( conn . getDB ( "admin" ) . runCommand ( { replSetGetStatus : 1 } ) ) ) ; var connStatus = replSetStatus . members . filter ( m => m . self ) [ 0 ] ; var opTime = connStatus . optime ; if ( _isEmptyOpTime ( opTime ) ) { throw new Error ( "last OpTime is empty -- connection: " + conn ) ; } return opTime ; }
Returns the OpTime for the specified host by issuing replSetGetStatus.
Returns the OpTime for the specified host by issuing replSetGetStatus .