0.0.8 • Published 8 years ago

ezway2mongo v0.0.8

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

ezway2mongo

简单的方式访问 mongodb, 使用了 mongodb 库 An easy way to access mongo with mongodb and yield.

And you can use the koaMiddleware method to map a crud rest api.

Usage

npm i --save ezway2mongo

First

Connect to your mongo db after your appliction started.

Remember connect only once.

var ezmongo = require('ezway2mongo');
ezmongo.connect('mongodb://localhost:27017/test');

Then

Use the methods

var result = yield ezmongo.find('collectionName', {a:1}, {skip:20, limit:20});

API

find

count

findOne

exists

insert

findOneAndUpdate

updateById

save

deleteOne

delete

sum

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago