modella plugin for leveldb
npm install modella-leveldb
var model = ;var level = './mydb';var uid = ;var User =;User;/*** Initialize*/var user = ;useridname'matt';user;
Initialize leveldb with a
path to the database. If path doesn't exist, it will be created.
options will be passed through to levelup
Alternatively, you can pass your own level
db instance in.
Create a secondary
index using leveldex. You may ensure that key is unique by passing
unique : true in
Userindex'email' unique: true ;
Get all models (static method)
Find a model (static method).
If you provide a secondary index, you can search by that key:
Save the model (instance method)
Remove the model (instance method)
options will be passed through to levelup.