Before you install a driver: install RethinkDB first.
Looking for another language? See the complete list of client drivers for RethinkDB.
Prerequisites: The JavaScript driver requires Node.js >= 0.10.0.
Install the driver with npm:
$ npm install rethinkdb
You can use the drivers from Node.js like this:
$ node
r = require('rethinkdb')
r.connect({ host: 'localhost', port: 28015 }, function(err, conn) {
if(err) throw err;
r.db('test').tableCreate('tv_shows').run(conn, function(err, res) {
if(err) throw err;
console.log(res);
r.table('tv_shows').insert({ name: 'Star Trek TNG' }).run(conn, function(err, res)
{
if(err) throw err;
console.log(res);
});
});
});
Move on to the ten-minute guide and learn how to use RethinkDB.