2018-01-09 15:36:42 +01:00

17 lines
311 B
JavaScript

module.exports = {
init: function () {
var _this = this;
return new Promise(function (resolve, reject) {
MongoClient.connect(config.mongodb, function (err, db) {
if (err) {
return reject(err);
}
_this.db = db;
resolve(_this);
});
});
}
};