dambreaker-mongo
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -47,3 +47,4 @@ /*! | ||
//https://github.com/mongodb/node-mongodb-native/blob/3.0.0/CHANGES_3.0.0.md#api-changes | ||
connectionString = user && password ? `mongodb://${user}:${password}@${host}:${port}/${database}` : `mongodb://${host}:${port}/${database}`; | ||
const portStr = port ? ":" + port : ""; //port is optional | ||
connectionString = user && password ? `mongodb://${user}:${password}@${host}${portStr}/${database}` : `mongodb://${host}${portStr}/${database}`; | ||
console.log("Mongo connection", connectionString); | ||
@@ -56,3 +57,3 @@ client = await MongoClient.connect(connectionString); | ||
} | ||
if (!db.collection) throw new Error("No collection for database ${host}:${port}.", { host, port, database }); | ||
if (!db.collection) throw new Error("No collection in database ${database} on ${host}:${port}.", { host, port, database }); | ||
@@ -59,0 +60,0 @@ this.connections[dbName] = { db, client, server }; |
{ | ||
"name": "dambreaker-mongo", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Mongo client for dambreaker", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
317966
1159