mm-rethinkdb-unique
v2.0.0
Published
Rethinkdb unique index helper extension for Matter In Motion
Downloads
2
Maintainers
Readme
Matter In Motion. Rethinkdb unique index helper extension
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.