How to use the rethinkdb.table function in rethinkdb

To help you get started, we’ve selected a few rethinkdb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trendscenter / coinstac / packages / coinstac-api-server / src / data / resolvers.js View on Github external
.then(connection =>
          rethink.table('pipelines')
            .orderBy({ index: 'id' })
            .map(pipeline =>
              pipeline.merge(pipeline =>
                ({
                  steps: pipeline('steps').map(step =>
                    step.merge({
                      computations: step('computations').map(compId =>
                        rethink.table('computations').get(compId)
                      )
                    })
                  )
                })
              )
            )
            .run(connection).then(res => connection.close().then(() => res))
        )
github ktbartholomew / tic-tac-toe / bot / index.js View on Github external
var storeFrames = function (currentGame) {
  var winner;
  if (currentGame.winner === null) {
    winner = '0';
  } else {
    winner = (currentGame.winner === 'x') ? '1' : '2';
  }

  currentGame.frames.forEach(function (frame, index, scope) {
    scope[index].result = winner;
  });

  return r.table('bot_stats').insert(currentGame.frames).run(conn);
};
github mtharrison / hapi.js-in-action / CH07 - Creating Modular Applications with Plugins / initial_application / index.js View on Github external
method: function (code, callback) {

        R
        .table('pings')
        .filter({ code: code })
        .orderBy(R.desc('timestamp'))
        .run(server.app.db, (err, cursor) => {

            if (err) {
                throw err;
            }

            cursor.toArray(callback);
        });
    }
});
github scotthasbrouck / 3RES-Stack-Sample-App / index.js View on Github external
socket.on('todo:client:insert', function(todo) {
			r.table('Todo').insert(todo).run(connection);
		});
github mtharrison / hapi.js-in-action / CH07 - Creating Modular Applications with Plugins / initial_application / index.js View on Github external
method: function (payload, callback) {

        R
        .table('pings')
        .insert(payload)
        .run(server.app.db, (err) => {

            if (err) {
                throw err;
            }

            callback();
        });
    }
});
github rystsov / perseus / rethinkdb / client / app / src / RethinkKV.js View on Github external
async create(key, value) {
        try {
            const conn = await this.pool.connect();
            const info = await r.table(this.table).insert({ 
                id: key,
                value: value
            }, {durability: "hard", returnChanges: false}).run(conn);
            if (info.inserted != 1) {
                throw new Error();
            }
            return true;
        } catch (e) {
            this.pool.reset();
            throw e;
        }
    }
    async update(key, value) {
github douglaszuqueto / estacionamento / back-end / sdk / src / db / model.js View on Github external
      .then((conn) => r.table(this.table).run(conn))
      .then((cursor) => cursor.toArray())
github incrediblesound / nebulaDB / src / write.js View on Github external
return r.connect(self.connection).then(function(conn){
    return r.table('data').insert(record).run(conn);
  })
}
github crrobinson14 / vue-rethinkdb / bridge / lib / Queries.js View on Github external
.merge(order => ({
            new_val: {
                user: r.table('users').get(order('new_val')('userId')).default({}),
                reseller: {
                    contact: r.table('contacts').get(order('new_val')('resellerContactId')).default({}),
                    company: r.table('resellers').get(order('new_val')('resellerId')).default({}),
                },
            }
        }));
github hoodsy / 3ree-auth-example / server / api / users.js View on Github external
export function getUserByEmail(conn, email) {
  return r
  .table('users')
  .getAll(email, { index: 'email' })
  .run(conn)
  .then(cursor => cursor.toArray())
  .then(user => user[0])
  .error(err => err)
}

rethinkdb

This package provides the JavaScript driver library for the RethinkDB database server for use in your node application.

Unknown
Latest version published 4 years ago

Package Health Score

61 / 100
Full package analysis