|
@ -390,14 +390,15 @@ function onCollection(err, collection) { |
|
|
var mongourl = "mongodb://playgrounduser:efvvnuioervefSDFSGYGHRDFVsdfergvssppiiedifhwincvinviw_dbfjbsifbsdkjfswuunscfudfgbbfvibqefwrvnine@ondemand_playground_mongo1:27017,ondemand_playground_mongo2:27017,ondemand_playground_mongo3:27017,ondemand_playground_mongo4:27017,ondemand_playground_mongo5:27017,ondemand_playground_mongo6:27017,ondemand_playground_mongo7:27017/fluent?replicaSet=rs1" |
|
|
var mongourl = "mongodb://playgrounduser:efvvnuioervefSDFSGYGHRDFVsdfergvssppiiedifhwincvinviw_dbfjbsifbsdkjfswuunscfudfgbbfvibqefwrvnine@ondemand_playground_mongo1:27017,ondemand_playground_mongo2:27017,ondemand_playground_mongo3:27017,ondemand_playground_mongo4:27017,ondemand_playground_mongo5:27017,ondemand_playground_mongo6:27017,ondemand_playground_mongo7:27017/fluent?replicaSet=rs1" |
|
|
//var mongolab_uri = "mongodb://<dbUser>:<dbPassword>@<host1>:<port1>,<host2>:<port2>/<dbName>?replicaSet=<replicaSetName>";
|
|
|
//var mongolab_uri = "mongodb://<dbUser>:<dbPassword>@<host1>:<port1>,<host2>:<port2>/<dbName>?replicaSet=<replicaSetName>";
|
|
|
var mongooptions = { |
|
|
var mongooptions = { |
|
|
server: { |
|
|
//server: {
|
|
|
socketOptions: { |
|
|
// socketOptions: {
|
|
|
autoReconnect: true, |
|
|
autoReconnect: true, |
|
|
keepAlive: 1, |
|
|
keepAlive: 1, |
|
|
connectTimeoutMS: 30000, |
|
|
connectTimeoutMS: 30000, |
|
|
socketTimeoutMS: 0 |
|
|
socketTimeoutMS: 0 |
|
|
} |
|
|
// }
|
|
|
}, |
|
|
//},
|
|
|
|
|
|
/* |
|
|
replSet: { |
|
|
replSet: { |
|
|
socketOptions: { |
|
|
socketOptions: { |
|
|
keepAlive: 1, |
|
|
keepAlive: 1, |
|
@ -405,12 +406,13 @@ var mongooptions = { |
|
|
socketTimeoutMS: 0 |
|
|
socketTimeoutMS: 0 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
*/ |
|
|
} |
|
|
} |
|
|
MongoClient.connect(mongourl, mongooptions, function(err, db){ |
|
|
MongoClient.connect(mongourl, mongooptions, function(err, db){ |
|
|
if(err){ |
|
|
if(err){ |
|
|
console.log(err); |
|
|
console.log(err); |
|
|
} else { |
|
|
} else { |
|
|
db.collections(function(err, collections) { |
|
|
db.collection(function(err, collections) { |
|
|
collections.forEach(function(coll) { |
|
|
collections.forEach(function(coll) { |
|
|
console.log(coll.s.name); |
|
|
console.log(coll.s.name); |
|
|
}); |
|
|
}); |
|
|