An agonstic session store for RethinkDB
npm install rethink-sessionjavascript
//Add RethinkDBDash
var r = require("rethinkdbdash");//Require the npm module
var session = require("rethink-session");
//Initialize the session store
session.init({
//Make sure to pass rethinkdbdash into the session store
"r": r,
"db": "selected database for sessions",
"table": "selected table for sessions"
})
//Store anything and it returns a token
session.store({
"key": "values"
}, function(token) {
//Retrieve it with the token returned (the document UUID)
var data = session.get(token, function(data) {
console.log(data);
});
})
``