Herton 7 years ago
parent
commit
c875317aa1
1 changed files with 10 additions and 1 deletions
  1. 10 1
      app.js

+ 10 - 1
app.js

@@ -9,5 +9,14 @@ app.use('assets', express.static(__dirname + '/public'));
 
 app.set('view engine', 'ejs');
 
-mongoose.connect(test);
+var promise = mongoose.createConnection(test, {
+  useMongoClient: true,
+  /* other options */
+});
+
+promise.then(function(db) {
+  /* Use `db`, for instance `db.model()`*/
+  console.log(db);
+});
+
 app.listen(port);