0.1.2 • Published 8 years ago
rethink-session v0.1.2
rethink-session
An agnostic session store for RethinkDB (RethinkDBDash)
By Chris Cates :star:
- :mailbox: hello@chriscates.ca
- :computer: http://chriscates.ca
Usage Example
//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);
});
})