Embedding ReQL in a programming language
RethinkDB provides client drivers for various programming languages. To explain, I am going to consider Node.js, and the steps are as follows:
You can start the ReQL exploration journey by connecting to the database.
Install the RethinkDB client module and make sure you have the RethinkDB server ready and running, listening to the default port.
Make sure you have done
npm install rethinkdb
before running the following code:var rethinkdb = require('rethinkdb'); var connection = null; rethinkdb.connect({host : 'localhost', port : 28015},function(err,conn) { if(err) { throw new Error('Connection error'); } else { connection = conn; } });
The preceding simple code snippet written in Node.js is importing the rethinkdb
module and connecting to the RethinkDB server on the default port. It returns the callback
function...