mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-11 06:20:11 -05:00
Fixed MongoDB connection string
This commit is contained in:
3
db.js
3
db.js
@@ -211,10 +211,7 @@ module.exports.CreateDB = function (parent, func) {
|
||||
Datastore = client;
|
||||
|
||||
// Get the database name and setup the database client
|
||||
var dbNamefromUrl = null;
|
||||
try { dbNamefromUrl = require('url').parse(parent.args.mongodb).path.split('/')[1]; } catch (ex) { }
|
||||
var dbname = 'meshcentral';
|
||||
if (dbNamefromUrl) { dbname = dbNamefromUrl; }
|
||||
if (parent.args.mongodbname) { dbname = parent.args.mongodbname; }
|
||||
const dbcollectionname = (parent.args.mongodbcol) ? (parent.args.mongodbcol) : 'meshcentral';
|
||||
const db = client.db(dbname);
|
||||
|
||||
Reference in New Issue
Block a user