mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Fixed MongoDB connection string
This commit is contained in:
parent
ec0047369b
commit
d0737562aa
6 changed files with 7 additions and 9 deletions
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue