Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including moleculer-db-adapter-rethinkdb with all npm packages installed. Try it out:

var moleculerDbAdapterRethinkdb = require("moleculer-db-adapter-rethinkdb")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

moleculer-db-adapter-rethinkdb v0.2.9

Moleculer service to support rethinkdb

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.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free