Skip to content

matter-in-motion/mm-rethinkdb-unique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.