Socket
Book a DemoInstallSign in
Socket

rethinkly

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rethinkly

a library to make easier the operation handling in rethinkdb

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Rethinkly 🚀

CircleCI Maintainability Test Coverage

👷 Work in progress 🚧

A carefuly created set of bindings to present an easy way to retrieve data from RethinkDB instances.

Rethinkly is a collection of methods to make more literal and legible gathering data from rethink into JavaScript applications. Supports node and browser.

Rethink. Again.

Installation

- $ yarn add rethinkly
- $ npm i rethinkly --save

Available methods:

  • rethinkly
  • retrieveData

Usage

import rethinkly from 'rethinkly'

const dbConfig = {
	host: 'localhost',
	port: 32769,
	db: 'the_database'
};

const instance = rethinkly(dbConfig);

API

retrieveData
  • Method to get a list or a specific value from a table.

Params:

  • connection: object
  • tableName: string
  • id?: string

Example

const rethinkly = require('rethinkly')
const instance = rethinkly(dbConfig)
// Select your database
instance.selectDB('rethinkly');

// Get your data as list
const users = instance.retrieveData('users')
/** output 
[
    {
        id: 'a3bbd8e3-b53f-4ecd-bab9-6c65cfcf931b',
        name: 'Caio Alcantara',
        nickname: 'caio',
        role: '99bd6af9-922e-4787-a97d-3d915f60e65b'
    }
]
*/


/**
* Match your results using where clause
*/
const users = instance.retrieveData('users', { role: '99bd6af9-922e-4787-a97d-3d915f60e65b' })
/**

* Implicit byId
*/
const users = instance.retrieveData('users', 'a3bbd8e3-b53f-4ecd-bab9-6c65cfcf931b')

/** output 
[
    {
        id: 'a3bbd8e3-b53f-4ecd-bab9-6c65cfcf931b',
        name: 'Caio Alcantara',
        nickname: 'caio',
        role: '99bd6af9-922e-4787-a97d-3d915f60e65b'
    }
]
*/

Keywords

rethinkdb

FAQs

Package last updated on 14 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts