ChicagoBoss get last entity

126 views Asked by At

I'm a new one in ChicagoBoss and Erlang. And I have dumb question: How can I get last entity from db? Something like User.last in Rails.

1

There are 1 answers

4
P_A On

You can use find_last BossDB function:

boss_db:find_last(type).

Query for the last BossRecord of type type

boss_db:find_last(type, [{foo, 'equals', <<"abc">>}, {bar, 'equals', 123}]).

Query for the last BossRecord of type type matching all of the given conditions.

Full API: http://www.chicagoboss.org/api-db.html