jbielick / kona-mongo

barebones mongodb client mixin for the kona application framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/});

About

barebones mongodb client mixin for the kona application framework

License:MIT License


Languages

Language:JavaScript 100.0%