|
|
@ -45,7 +45,7 @@
|
|
|
|
winston.error('Unable to initialize MongoDB! Is MongoDB installed? Error :' + err.message);
|
|
|
|
winston.error('Unable to initialize MongoDB! Is MongoDB installed? Error :' + err.message);
|
|
|
|
process.exit();
|
|
|
|
process.exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mongoClient.connect('mongodb://'+ nconf.get('mongo:host') + ':' + nconf.get('mongo:port') + '/' + nconf.get('mongo:database'), function(err, _db) {
|
|
|
|
mongoClient.connect('mongodb://'+ nconf.get('mongo:host') + ':' + nconf.get('mongo:port') + '/' + nconf.get('mongo:database'), function(err, _db) {
|
|
|
|
if(err) {
|
|
|
|
if(err) {
|
|
|
|
winston.error("NodeBB could not connect to your Mongo database. Mongo returned the following error: " + err.message);
|
|
|
|
winston.error("NodeBB could not connect to your Mongo database. Mongo returned the following error: " + err.message);
|
|
|
@ -105,6 +105,11 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.close = function() {
|
|
|
|
|
|
|
|
db.close();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var helpers = {};
|
|
|
|
var helpers = {};
|
|
|
|
helpers.findItem = function(data, key) {
|
|
|
|
helpers.findItem = function(data, key) {
|
|
|
|
if(!data) {
|
|
|
|
if(!data) {
|
|
|
|