# thinodium-rethinkdb

> RethinkDB adapter for Thinodium ODM library

Latest version **1.2.0** (published 2017-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install thinodium-rethinkdb
pnpm add thinodium-rethinkdb
yarn add thinodium-rethinkdb
bun add thinodium-rethinkdb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-01-15 |
| First published | 2016-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ramesh Nair |
| Maintainers | hiddentao |
| Keywords | odm, rethinkdb, thinodium, db, adapter, plugin |

## Links

- npm: https://www.npmjs.com/package/thinodium-rethinkdb
- Repository: https://github.com/thinodium/thinodium-rethinkdb
- Homepage: https://github.com/thinodium/thinodium-rethinkdb#readme
- Issues: https://github.com/thinodium/thinodium-rethinkdb/issues
- npm.io page: https://npm.io/package/thinodium-rethinkdb

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.15.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.6
- [rethinkdbdash](https://npm.io/package/rethinkdbdash.md) ^2.3.21

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 1.2.0 (latest) — 2017-01-15
- 1.1.3 — 2016-12-28
- 1.1.2 — 2016-09-12
- 1.1.1 — 2016-05-13
- 1.1.0 — 2016-05-10
- 1.0.3 — 2016-05-10
- 1.0.1 — 2016-05-05
- 1.0.0 — 2016-05-05

## README

# Thinodium RethinkDB adapter

[![Build Status](https://travis-ci.org/thinodium/thinodium-rethinkdb.svg?branch=master)](http://travis-ci.org/thinodium/thinodium-rethinkdb)
[![npm](https://img.shields.io/npm/v/thinodium-rethinkdb.svg?maxAge=2592000)](https://www.npmjs.com/package/thinodium-rethinkdb)
[![Join the chat at https://discord.gg/bYt4tWB](https://img.shields.io/badge/discord-join%20chat-738bd7.svg?style=flat-square)](https://discord.gg/bYt4tWB)
[![Follow on Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/hiddentao)

A RethinkDB adapter for [thinodium](https://github.com/thinodium/thinodium)
which internally uses [rethinkdbdash](https://github.com/neumino/rethinkdbdash).

Features:

* Creates tables and indexes if they don't already exist.

## Installation

```bash
$ npm install thinodium thinodium-rethinkdb
```

## Usage examples

```js
const Thinodium = require('thinodium');

const db = yield Thinodium.connect('rethinkdb', {
  // db name
  db: 'mydb',
  /* all options get passed to rethinkdbdash module */
  ...
});

/*
  This will create the "User" table and all specifies indexes if they
  don't already exist.
 */
const User = yield db.model('User', {
  indexes: [
    // single-value field
    {
      name: 'username',
    },
    // a multivalue field
    {
      name: 'roles',
      options: {
        multi: true,
      },
    },  
    // totally custom indexing function
    {
      name: 'email',
      def: function(doc) {
        return doc('emails')('email');
      },
      options: {
        multi: true,
      },
    },
  ],
});

// insert a new user
let user = yield User.insert({
  name: 'john'
});

// ... normal thinodium API methods available at this point
```

Check out the [thinodium docs](https://hiddentao.github.io/thinodium) for further usage examples and API docs.

## Building

To run the tests you will need [RethinkDB](https://www.rethinkdb.com/) installed
and running with default host and port settings. Then on the command-line:

    $ npm install
    $ npm test

## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](https://github.com/thinodium/thinodium-rethinkdb/blob/master/CONTRIBUTING.md).

## License

MIT - see [LICENSE.md](https://github.com/thinodium/thinodium-rethinkdb/blob/master/LICENSE.md)

---
_Source: https://npm.io/package/thinodium-rethinkdb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
