endex
Ensure indexes (and tables, and DBs...) exist
This library is designed for initializing RethinkDB databases, although the approach / interface could, conceivably, be extended or copied for systems like MongoDB.
Example
var r = ;var endex = ;r;
r
Ensuring the same As the RethinkDB driver currently requires the same exact module be used to construct queries as the connections they're run on, this module has two mechanisms to ensure this is the case.
Firstly, this module (as of 0.2.0) does not include its own rethinkdb
: it
only lists rethinkdb
in peerDependencies
, so as to defer to whatever
rethinkdb
instance is included above it in the tree.
Secondly, if your package situation is more complex than this (or if you're
using an alternative implementation like reqlite
or rethinkdbdash
), you
may provide your rethinkdb
(compatible) instance via the "r" option to the
main endex
constructor:
var r = pool: false cursor: true;var endex = ;r;