kona-mongo

1.0.1 • Public • Published

This kona mixin mounts a mongodb client connection to the abstract controller prototype so you can do mongo queries from controllers and elsewhere.

Example config in config/application.js:

  config.mongo = 'mongodb://localhost:27017/my_app_database';

These details will be passed straight to the mongo native client.

In your controller, you now have a mongo connection checked out from the pool:

var users = yield this.mongo.collection('users');
var user = yield users.findOne({name: /creed/});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    1
  • 0.3.0
    1
  • 0.2.0
    1

Package Sidebar

Install

npm i kona-mongo

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

3.04 kB

Total Files

4

Last publish

Collaborators

  • jbielick