dont do utf8 validation for mongodb #6340

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-08-24 00:12:14 +01:00
parent 0ccce62c9d
commit 21e196e35c

2
db.js
View File

@ -882,7 +882,7 @@ module.exports.CreateDB = function (parent, func) {
if (global.TextEncoder == null) { global.TextEncoder = require('util').TextEncoder; }
if (global.TextDecoder == null) { global.TextDecoder = require('util').TextDecoder; }
require('mongodb').MongoClient.connect(parent.args.mongodb, { useNewUrlParser: true, useUnifiedTopology: true }, function (err, client) {
require('mongodb').MongoClient.connect(parent.args.mongodb, { useNewUrlParser: true, useUnifiedTopology: true, enableUtf8Validation: false }, function (err, client) {
if (err != null) { console.log("Unable to connect to database: " + err); process.exit(); return; }
Datastore = client;
parent.debug('db', 'Connected to MongoDB database...');