This post will describe installation and interaction with rethinkDB using Javascript/Node.js. Ultimately I want to hook rethinkDB to Shiny. I am working on Debian/Jessie. Currently (August, 2017) rethinkDB will not install on Stretch.
Installation
1 | #echo "deb http://download.rethinkdb.com/apt `lsb_release -cs` main" | tee /etc/apt/sources.list.d/rethinkdb.list |
Start the server with the command “rethinkdb” at a terminal prompt. By default administrative tools are available at localhost:8080/.
Client driver installation
cd to the working directory then install a node project
1 | mbc@dc7700s: cd ./syncd/prog/shiny/music |
Set the conn variable and interact with the database
1 | mbc@dc7700s:~/syncd/prog/shiny/music$ node |
Insert
1 | r.db('shiny').table('music').insert([{artist:'Boston', |
Update
1 | r.db('shiny').table('music'). |
Show all
1 | r.db('shiny').table('music').distinct().run(connection, function(err, result) { |
Delete all
1 | r.db('shiny').table('music').delete().run(connection, function(err, result) { |
Launch script
The ‘launch.browser’ option to runApp() deals with the random port assigned by Shiny.
1 |
|