rethink-driver

0.1.2 • Public • Published

rethinkdb-driver

Installation

  1. Install RethinkDB
  2. Download sources from github or with npm npm install rethink-driver
  3. Run npm install in rethink-driver directory

Usage

If you don't provide the connection details, the default details will be used.

var RethinkDB = require('rethink-driver');
var db = new RethinkDB(host, port, dbName);
db.connect(connectedCallback);

function connectedCallback(conn) {
	// ...
}

Overview

Example

var query = db.QueryFactory.Find.create('test_table');
db.executeQuery(query).then(function (result) {
    if (result.hasError()) {
        console.log(result.getError());
        return;
    }

	result.getResultSet().cursor...;
});

Allow to array conversation

db.allowToArrayConversation();

You can access the items from the cursor as an array:

for (result.getResultSet().getList() as item) {
	// ...
}

In some cases it could be totally not useful. That it the reason, why its false by default.

Running the tests

Create a database named rethink_db_test first.

nodejs tests -log=4

Package Sidebar

Install

npm i rethink-driver

Weekly Downloads

0

Version

0.1.2

License

UNLICENSED

Last publish

Collaborators

  • etwillbefine