From 7ea744fdfe3d74ed2d07973ba8024423432dc605 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Thu, 7 Sep 2023 19:31:26 +0100 Subject: [PATCH] use new nedb instead of old --- db.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db.js b/db.js index 4fd9fbb4..353d18f5 100644 --- a/db.js +++ b/db.js @@ -3181,7 +3181,10 @@ module.exports.CreateDB = function (parent, func) { // Transfer NeDB data into the current database obj.nedbtodb = function (func) { - var nedbDatastore = require('nedb'); + var nedbDatastore = null; + try { nedbDatastore = require('@yetzt/nedb'); } catch (ex) { } // This is the NeDB with fixed security dependencies. + if (nedbDatastore == null) { nedbDatastore = require('nedb'); } // So not to break any existing installations, if the old NeDB is present, use it. + var datastoreOptions = { filename: parent.getConfigFilePath('meshcentral.db'), autoload: true }; // If a DB encryption key is provided, perform database encryption