2.0.0 • Published 6 years ago

mm-rethinkdb-unique v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Matter In Motion. Rethinkdb unique index helper extension

NPM Version NPM Downloads

Rethinkdb unique index helper extension for matter in motion framework

As rethinkdb doesn't have unique second indexes support this extension provides method to make that possible

Usage

Extensions installation instructions

This extension adds a db.rethinkdb.unquie unit.

Dependencies

Methods

  • table — table name, that will be used as index
  • id — id, is a string or number that should be unique

All methods return a Promise. If id is not unique all methods throw a Duplicate entity error with code 4500.

ensure(table, id)

Ensures that id is unique.

delete(table, id)

Deletes id from the index.

rename(table, id, newId)

Renames id to newId.

License: MIT.