This commit is contained in:
Barış Soner Uşaklı
2018-10-16 20:27:14 -04:00
parent 154d7076d9
commit 0aebb9caf8
2 changed files with 6 additions and 4 deletions

View File

@@ -77,9 +77,9 @@ mongoModule.getConnectionString = function () {
if (!nconf.get('mongo:port')) {
nconf.set('mongo:port', 27017);
}
console.log(nconf.get('mongo:database'), typeof nconf.get('mongo:database'));
if (!nconf.get('mongo:database')) {
console.log('switching to nodebb database');
const dbName = nconf.get('mongo:database');
if (dbName === undefined || dbName === '') {
winston.warn('You have no database name, using "nodebb"');
nconf.set('mongo:database', 'nodebb');
}