We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e9d6b6b + 3fbec85 commit 80621c9Copy full SHA for 80621c9
generated/server/db/index.js
@@ -13,8 +13,11 @@ var db = mongoose.connect(DATABASE_URI).connection;
13
// anywhere the User model needs to be used.
14
require('./models');
15
16
+// Modifying startDbPromise to return the db object to have an access to it when .then on startDbPromise
17
var startDbPromise = new Promise(function (resolve, reject) {
- db.on('open', resolve);
18
+ db.on('open', function() {
19
+ resolve(db)
20
+ });
21
db.on('error', reject);
22
});
23
0 commit comments