How to use the rethinkdb.eq 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 hyperledger / sawtooth-core / families / track_and_trade / server / db / records.js View on Github external
const getValue = dataType => value => {
  return r.branch(
    r.eq(dataType, 'INT'), value('intValue'),
    r.eq(dataType, 'STRING'), value('stringValue'),
    r.eq(dataType, 'FLOAT'), value('floatValue'),
    r.eq(dataType, 'BYTES'), value('bytesValue'),
    r.eq(dataType, 'LOCATION'), value('locationValue'),
    value('bytesValue') // if dataType is unknown, use bytesValue
  )
}
github hyperledger / sawtooth-core / families / track_and_trade / server / db / records.js View on Github external
const getValue = dataType => value => {
  return r.branch(
    r.eq(dataType, 'INT'), value('intValue'),
    r.eq(dataType, 'STRING'), value('stringValue'),
    r.eq(dataType, 'FLOAT'), value('floatValue'),
    r.eq(dataType, 'BYTES'), value('bytesValue'),
    r.eq(dataType, 'LOCATION'), value('locationValue'),
    value('bytesValue') // if dataType is unknown, use bytesValue
  )
}
github hyperledger / sawtooth-core / families / track_and_trade / server / db / records.js View on Github external
const getValue = dataType => value => {
  return r.branch(
    r.eq(dataType, 'INT'), value('intValue'),
    r.eq(dataType, 'STRING'), value('stringValue'),
    r.eq(dataType, 'FLOAT'), value('floatValue'),
    r.eq(dataType, 'BYTES'), value('bytesValue'),
    r.eq(dataType, 'LOCATION'), value('locationValue'),
    value('bytesValue') // if dataType is unknown, use bytesValue
  )
}
github hyperledger / sawtooth-core / families / track_and_trade / server / db / records.js View on Github external
const getValue = dataType => value => {
  return r.branch(
    r.eq(dataType, 'INT'), value('intValue'),
    r.eq(dataType, 'STRING'), value('stringValue'),
    r.eq(dataType, 'FLOAT'), value('floatValue'),
    r.eq(dataType, 'BYTES'), value('bytesValue'),
    r.eq(dataType, 'LOCATION'), value('locationValue'),
    value('bytesValue') // if dataType is unknown, use bytesValue
  )
}
github outmoded / penseur / lib / modifier.js View on Github external
const each = (change) => {

            const without = [];
            const wrapped = internals.wrap(change, without, item, []);

            let update = item;
            if (without.length) {
                update = update.without(without);
            }

            if (wrapped) {
                update = update.merge(wrapped);
            }

            return RethinkDB.branch(RethinkDB.eq(item, null), RethinkDB.error('No document found'), update);
        };
github hyperledger / sawtooth-core / families / track_and_trade / server / db / records.js View on Github external
const hasAttribute = getAttr => attr => obj => r.eq(attr, getAttr(obj))
const hasName = hasAttribute(getName)
github mikemintz / rethinkdb-websocket-server / src / ReqlTermExamples.js View on Github external
export default {
  DATUM: r(1),
  MAKE_ARRAY: r([]),
  MAKE_OBJ: r({}),
  VAR: r(x => x).args[1],
  JAVASCRIPT: r.js(''),
  UUID: r.uuid(),
  HTTP: r.http(''),
  ERROR: r.error(),
  IMPLICIT_VAR: r.row,
  DB: r.db(''),
  TABLE: r.table(''),
  GET: r({}).get(''),
  GET_ALL: r({}).getAll(''),
  EQ: r.eq(),
  NE: r.ne(),
  LT: r.lt(),
  LE: r.le(),
  GT: r.gt(),
  GE: r.ge(),
  NOT: r.not(),
  ADD: r.add(),
  SUB: r.sub(),
  MUL: r.mul(),
  DIV: r.div(),
  MOD: r.mod(),
  FLOOR: r.floor(),
  CEIL: r.ceil(),
  ROUND: r.round(),
  APPEND: r([]).append(),
  PREPEND: r([]).prepend(),
github hyperledger / sawtooth-core / families / track_and_trade / server / db / agents.js View on Github external
const hasPublicKey = key => obj => {
  return r.eq(
    key,
    getPublicKey(obj)
  )
}

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