Unified mongo and email style

This commit is contained in:
Tankred Hase
2016-06-08 14:01:30 +02:00
parent 56162a01d9
commit b5fb5331fc
7 changed files with 17 additions and 32 deletions

View File

@@ -25,21 +25,15 @@ const MongoClient = require('mongodb').MongoClient;
class Mongo {
/**
* Create an instance of the MongoDB client.
* Initializes the database client by connecting to the MongoDB.
* @param {String} uri The mongodb uri
* @param {String} user The databse user
* @param {String} pass The database user's password
*/
constructor(options) {
this._uri = 'mongodb://' + options.user + ':' + options.pass + '@' + options.uri;
}
/**
* Initializes the database client by connecting to the MongoDB.
* @yield {undefined}
*/
*connect() {
this._db = yield MongoClient.connect(this._uri);
*init(options) {
let uri = 'mongodb://' + options.user + ':' + options.pass + '@' + options.uri;
this._db = yield MongoClient.connect(uri);
}
/**