mongoosedao = mongoose data access object
npm install --save mongoosedao
require('./db');
var User = require('./User');
User.create({"username":"sss","password":"password"},function(err, user){
console.log(user);
});
User.delete({"username":"sss","password":"password"},function(err, user){
console.log(user);
});
Test status
- create
- delete = remove
- deleteAll = removeAll
- deleteById = removeById
- getById
- all = getAll = find({})
- query = getByQuery = find
- one = findOne
- update
- updateOne
- updateById
- pageByLastId
- top(num) && first(num) = n(num) = latest(num)
- count(cb) &* count({},cb)
more see api doc
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- v1.0.8 add mocha test && api.md
- v1.0.5 add query with condition
- v1.0.4 create with saved_doc return;
- v1.0.3 add updateById
- v1.0.2 add deleteById
- v1.0.0 初始化版本
- write by
i5ting
shiren1118@126.com
如有建议或意见,请在issue提问或邮件
this repo is released under the MIT License.