Fix strictQuery warning from new mongoose versions
-Suppress the "DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7" warning msg when starting the explorer and using any of the scripts that connect to mongo
This commit is contained in:
@@ -256,6 +256,8 @@ function init_heavy(cb) {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
// initialize DB
|
// initialize DB
|
||||||
connect: function(database, cb) {
|
connect: function(database, cb) {
|
||||||
|
mongoose.set('strictQuery', true);
|
||||||
|
|
||||||
mongoose.connect(database, function(err) {
|
mongoose.connect(database, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Error: Unable to connect to database: %s', database);
|
console.log('Error: Unable to connect to database: %s', database);
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ dbString = dbString + '@' + settings.dbsettings.address;
|
|||||||
dbString = dbString + ':' + settings.dbsettings.port;
|
dbString = dbString + ':' + settings.dbsettings.port;
|
||||||
dbString = dbString + "/IQUIDUS-BENCHMARK";
|
dbString = dbString + "/IQUIDUS-BENCHMARK";
|
||||||
|
|
||||||
|
mongoose.set('strictQuery', true);
|
||||||
|
|
||||||
mongoose.connect(dbString, function(err) {
|
mongoose.connect(dbString, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Error: Unable to connect to database: %s', dbString);
|
console.log('Error: Unable to connect to database: %s', dbString);
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ rl.question('Are you sure you want to do this? [y/n]: ', function (deleteAnswer)
|
|||||||
|
|
||||||
console.log('Connecting to database..');
|
console.log('Connecting to database..');
|
||||||
|
|
||||||
|
mongoose.set('strictQuery', true);
|
||||||
|
|
||||||
// connect to mongo database
|
// connect to mongo database
|
||||||
mongoose.connect(dbString, function(err) {
|
mongoose.connect(dbString, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ function delete_database(mongoose, settings, cb) {
|
|||||||
|
|
||||||
console.log('Connecting to database..');
|
console.log('Connecting to database..');
|
||||||
|
|
||||||
|
mongoose.set('strictQuery', true);
|
||||||
|
|
||||||
// connect to mongo database
|
// connect to mongo database
|
||||||
mongoose.connect(dbString, function(err) {
|
mongoose.connect(dbString, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@@ -359,6 +359,8 @@ if (lib.is_locked([database]) == false) {
|
|||||||
dbString = dbString + ':' + settings.dbsettings.port;
|
dbString = dbString + ':' + settings.dbsettings.port;
|
||||||
dbString = dbString + '/' + settings.dbsettings.database;
|
dbString = dbString + '/' + settings.dbsettings.database;
|
||||||
|
|
||||||
|
mongoose.set('strictQuery', true);
|
||||||
|
|
||||||
mongoose.connect(dbString, function(err) {
|
mongoose.connect(dbString, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Error: Unable to connect to database: %s', dbString);
|
console.log('Error: Unable to connect to database: %s', dbString);
|
||||||
|
|||||||
Reference in New Issue
Block a user