Skip to content

Latest commit

 

History

History
39 lines (21 loc) · 1.25 KB

readme.md

File metadata and controls

39 lines (21 loc) · 1.25 KB

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.