|
@@ -49,7 +49,9 @@ module.exports = {
|
|
connect:function (env="local") {
|
|
connect:function (env="local") {
|
|
var config = require("../config.js");
|
|
var config = require("../config.js");
|
|
var dbURL = 'mongodb://' + config[env].server + ":" + config[env].port + '/scConstruct';
|
|
var dbURL = 'mongodb://' + config[env].server + ":" + config[env].port + '/scConstruct';
|
|
- if(config[env].options){
|
|
|
|
|
|
+ if(config[env].dbURL){
|
|
|
|
+ mg.connect(config[env].dbURL,{connectTimeoutMS: 20000,useMongoClient: true});
|
|
|
|
+ } else if(config[env].options){
|
|
mg.connect(dbURL,config[env].options);
|
|
mg.connect(dbURL,config[env].options);
|
|
}else {
|
|
}else {
|
|
mg.connect(dbURL,{connectTimeoutMS: 20000,useMongoClient: true});//useMongoClient': true*! //报 DeprecationWarning: `open()` is deprecated in mongoose这个错
|
|
mg.connect(dbURL,{connectTimeoutMS: 20000,useMongoClient: true});//useMongoClient': true*! //报 DeprecationWarning: `open()` is deprecated in mongoose这个错
|