modelis-monk
monk plugin for modelis.
monk
Export API
- Repository.connection
- Repository.collection
- Repository.drop
- Repository.find
- Repository.findOne
- Repository.findById
- Repository.findAndModify
- Repository.insert
- Repository.update
- Repository.remove
- methods.insert
- methods.update
- methods.remove
Option
connection
(required)- monk connection.
collection
(required)- mongodb collection name.
option
(optional)- option.created
- modelis created attr name.
- default:
created
- option.updated
- modelis updated attr name.
- default:
updated
- option.created
Example
use.
var Modelis = ;var monk = ; // define.var User = Modelis; if simple // use. User; // User.Repository available. UserRepository; // methods available. {}; if customize // use. User; // User.Store available. UserStore; // methods available. {};
callback
var Modelis = ;var monk = ; // define.var User = Modelis; // use.User; // connection.UserRepository; //=> monk connection. // collection.UserRepository; //=> monk collection. // insert. name: 'john' age: 19 ;
generators(co)
var Modelis = ;var monk = ;var co = ; // define.var User = Modelis; // define plugin.User; ;