turtlesoup
Minimal Event Sourcing helper for RethinkDB & node.js
install
npm install turtlesoup --save
usage
/*// first create a db and tablevar r = require('rethinkdb');r.connect(function (err, conn) { r.create('demo').tableCreate('bucket').run(conn, function (){});});*/var _turtlesoup = ;var turtlesoup = 'demo' 'bucket' ;
methods
add
turtlesoup;
Add a new JSON object with mandatory timestamp field which needs to be a Javascript Date object.
get_all
turtlesoup; // or turtlesoup
Returns an array of all items in the table.
get_all_latest
turtlesoup; // or turtlesoup
Returns an array of all the items in the table with the latest first.
pull_all
// or turtlesoup // filter on demo === true
Get each data item from a pull stream source.
pull_all_latest
// turtlesoup // filter on demo === true
Get each item from a pull stream source with the latest coming first.