lib/dataset/actions.js
function (args) {
            if (!this.__opts.order) {
                throw new QueryError("No order specified");
            }
            var ds = this.reverse();
            return ds.first.apply(ds, arguments);
        }
function (args) {
            if (!this.__opts.order) {
                throw new QueryError("No order specified");
            }
            var ds = this.reverse();
            return ds.first.apply(ds, arguments);
        }
function ( args ) { if ( ! this . __opts . order ) { throw new QueryError ( "No order specified" ) ; } var ds = this . reverse ( ) ; return ds . first . apply ( ds , arguments ) ; }
Reverses the order and then runs first.  Note that this
will not necessarily give you the last record in the dataset,
unless you have an unambiguous order.

@example

// SELECT * FROM table ORDER BY id DESC LIMIT 1
DB.from("table").order("id").last().chain(function(lastItem){
//...(e.g lastItem === {id : 10})
});

// SELECT * FROM table ORDER BY id ASC LIMIT 2
DB.from("table").order(sql.id.desc()).last(2).chain(function(lastItems){
//...(e.g lastItems === [{id : 1}, {id : 2});
});

@throws {patio.error.QueryError} If there is not currently an order for this dataset.

@param {*} args See {@link patio.Dataset#first} for argument types.

@return {comb.Promise} a promise that will be resolved with a single object or array depending on the
arguments provided.
Reverses the order and then runs first . Note that this will not necessarily give you the last record in the dataset unless you have an unambiguous order .