File tree 6 files changed +7
-3
lines changed
6 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 29
29
"babel-runtime" : " ^6.18.0" ,<% if(filters.pug) { %>
30
30
"pug" : " ^2.0.0" ,<% } %><% if(filters.html) { %>
31
31
"ejs" : " ^2.5.3" ,<% } %><% if(filters.mongoose) { %>
32
- "mongoose" : " ^4.13.14 " ,
32
+ "mongoose" : " ^5.1.5 " ,
33
33
"bluebird" : " ^3.3.3" ,
34
34
"connect-mongo" : " ^2.0.1" ,<% } %><% if(filters.sequelize) { %>
35
35
"sequelize" : " ^3.23.6" ,
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ var config = {
90
90
91
91
// Setup mongo for tests
92
92
var mongoose = require('mongoose');
93
- mongoose.connect(serverConfig.mongo.uri, serverConfig.mongo.options); // Connect to database< % } % >
93
+ return mongoose.connect(serverConfig.mongo.uri, serverConfig.mongo.options); // Connect to database< % } % >
94
94
}
95
95
} ;
96
96
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import seedDatabaseIfNeeded from './config/seed';<% } %>
16
16
17
17
< % if ( filters . mongoose ) { % >
18
18
// Connect to MongoDB
19
- mongoose.connect(config.mongo.uri, config.mongo.options);
19
+ const mongooseConnectionPromise = mongoose.connect(config.mongo.uri, config.mongo.options);
20
20
mongoose.connection.on('error', function(err) {
21
21
console . error ( 'MongoDB connection error: ' + err ) ;
22
22
process . exit ( - 1 ) ; // eslint-disable-line no-process-exit
@@ -53,6 +53,7 @@ wsInitPromise
53
53
. then ( primus => {
54
54
app . primus = primus ;
55
55
} ) < % if ( filters . models ) { % >
56
+ . then ( ( ) => mongooseConnectionPromise )
56
57
. then ( seedDatabaseIfNeeded ) < % } %>
57
58
. then ( startServer )
58
59
. catch ( err => {
Original file line number Diff line number Diff line change 6
6
module . exports = { < % if ( filters . mongoose ) { % >
7
7
// MongoDB connection options
8
8
mongo : {
9
+ useMongoClient : true ,
9
10
uri : process . env . MONGODB_URI || 'mongodb://localhost/<%= lodash.slugify(appname) %>-dev'
10
11
} , < % } if ( filters . sequelize ) { % >
11
12
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ module.exports = {
16
16
17
17
// MongoDB connection options
18
18
mongo : {
19
+ useMongoClient : true ,
19
20
uri : process . env . MONGODB_URI
20
21
|| process . env . MONGOHQ_URL
21
22
|| process . env . OPENSHIFT_MONGODB_DB_URL + process . env . OPENSHIFT_APP_NAME
Original file line number Diff line number Diff line change 6
6
module . exports = {
7
7
// MongoDB connection options
8
8
mongo : {
9
+ useMongoClient : true ,
9
10
uri : 'mongodb://localhost/<%= lodash.slugify(appname) %>-test'
10
11
} ,
11
12
sequelize : {
You can’t perform that action at this time.
0 commit comments