Skip to content

Commit

Permalink
FIX upgrade mongodb to 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Jun 22, 2022
1 parent b6f4360 commit 1aac1ef
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fix: replace git:// to https:// url for npm dependences
- Fix: Dockerfile to include initial packages upgrade
- Upgrade mongodb dev dep from 3.5.9 to 4.7.0
- Upgrade NodeJS version from 14-slim to 16-slim in Dockerfile
5 changes: 4 additions & 1 deletion lib/iotagentCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ function deviceProvisioningMiddleware(device, callback) {
if (!mappingFound) {
config.getLogger().error(context, 'device provisioning mapping not found');
callback(new errors.DataMappingNotFound(device.type), device);
} else {
callback(null, device);
}
} else {
callback(null, device);
}
callback(null, device);
}

function initialize(callback) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"husky": "~4.2.5",
"lint-staged": "~10.2.11",
"mocha": "8.0.1",
"mongodb": "3.5.9",
"mongodb": "4.7.0",
"nock": "13.0.3",
"nyc": "~15.1.0",
"prettier": "~2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion test/tools/mongoDBUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function cleanDb(host, name, callback) {
const url = 'mongodb://' + host + ':27017/' + name;

/* eslint-disable-next-line no-unused-vars */
MongoClient.connect(url, { useNewUrlParser: true }, function (err, db) {
MongoClient.connect(url, function (err, db) {
if (db && db.db()) {
/* eslint-disable-next-line no-unused-vars */
db.db().dropDatabase(function (err, result) {
Expand Down

0 comments on commit 1aac1ef

Please sign in to comment.