Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/homuchen/rethinkdb-store
A high level nodejs rethinkdb client library
https://github.com/homuchen/rethinkdb-store
datastore nodejs rethinkdb
Last synced: about 1 month ago
JSON representation
A high level nodejs rethinkdb client library
- Host: GitHub
- URL: https://github.com/homuchen/rethinkdb-store
- Owner: HoMuChen
- Created: 2018-10-02T08:55:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-23T03:12:41.000Z (almost 6 years ago)
- Last Synced: 2024-11-28T14:07:42.915Z (about 1 month ago)
- Topics: datastore, nodejs, rethinkdb
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rethinkdb-store
A high level nodejs library for accessing rethinkdb data.## Install
``` bash
$ npm install rethinkdb-store
```## Usage
```javascript
const store = require('rethinkdb-store');//Or config througth environment vars `RTK_HOST`, `RTK_PORT`, `RTK_DB`
store.setConfig({
host: 'localhost',
port: 28015,
db: 'test'
})
```### Writing data
```javascript
store.insert({host, port, db, table, docs}) -> object
``````javascript
store.upsert({host, port, db, table, docs, resolver}) -> object
`````` javascript
store.delete({host, port, db, table, id}) -> object
```### Selecting data
```javascript
store.getById({host, port, db, table, id, fields}) -> object
``````javascript
store.getAll({host, port, db, table, fields}) -> object
``````javascript
store.getByIndex({host, port, db, table, index, value, page, size, fields}) -> object
`````` javascript
store.sampleByIndex({host, port, db, table, index, value, sample, fields}) -> object
`````` javascript
store.getByIndex({host, port, db, table, index, value, page, size, fields}) -> object
`````` javascript
store.betweenByIndex({host, port, db, table, index, from, to, page, size, fields}) -> object
```