RethinkDB moleculer service mixin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples mini fix for simple testing Feb 10, 2019
src quick minor fix Feb 10, 2019
test/unit test correction Jan 24, 2019
.eslintrc.js inital codes Jan 20, 2019
.gitignore init Jan 20, 2019
.travis.yml added travis.yml and coveralls package Jan 24, 2019 readme update for some incorrect code example Jan 25, 2019
index.js inital codes Jan 20, 2019
package-lock.json 0.2.10 Feb 10, 2019
package.json 0.2.10 Feb 10, 2019

Moleculer logo


RethinkDB adapter for Moleculer DB service.

Coverage Status Build Status NPM version Downloads


$ npm install moleculer-db moleculer-db-adapter-rethinkdb --save


"use strict";

const { ServiceBroker } = require("moleculer");
const DbService = require("moleculer-db");
const RethinkDBAdapter = require("moleculer-db-adapter-rethinkdb");

const broker = new ServiceBroker();

// Create a RethinkDB service for `post` entities
    name: "posts",
    mixins: [DbService],
    adapter: new RethinkDBAdapter({host: "" || "", port: 29015}),
    database: "app",
    table: "posts"

// Create a new post
.then(() =>"posts.create", {
    title: "My first post",
    content: "Lorem ipsum...",
    votes: 0

// Get all posts
.then(() =>"posts.find").then(console.log));

// Change feeds
const { client: conn } = this.schema.adapter;
// Lets get a rethinkdb.table instance
const rTable = this.schema.adapter.getTable();
// You can also get a rethinkdb instance with below
// const rethinkdb = this.schema.adapter.getR();

rTable.changes().run(conn, function(err, cursor) {

// Map Reduce with same way => 1).run(conn);

// You can access all underlying API


Example with connection options

new RethinkDBAdapter({
    host: "localhost",
    port: 29015

Above options is used as default when you dont specify any option or pass empty


$ npm test

In development with watching

$ npm run ci


The project is available under the MIT license.