def get_optime_tokumx(mc):
    """ Get optime of primary in the replica set.
    """
    rs_status = mc['admin'].command({'replSetGetStatus': 1})
    members = rs_status.get('members')
    if members:
        for member in members:
            role = member.get('stateStr')
            if role == 'PRIMARY':
                optime = member.get('optimeDate')
                return optime
    return None