Skip to content

Commit

Permalink
chore(deps): bump [email protected] and fix error #48 (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonnilsson authored Aug 3, 2020
1 parent dece3c5 commit 6ca1ffa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"dependencies": {
"aedes-cached-persistence": "^8.1.0",
"escape-string-regexp": "^4.0.0",
"mongodb": "^3.5.6",
"mongodb": "^3.6.0",
"native-url": "^0.3.1",
"pump": "^3.0.0",
"qlobber": "^5.0.0",
Expand Down
10 changes: 6 additions & 4 deletions persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ function executeBulk (that) {
var criteria = { topic: p.packet.topic }

if (p.packet.payload.length > 0) {
bulk.find(criteria).upsert().updateOne(decoratePacket(p.packet, that._opts))
bulk.find(criteria).upsert().updateOne({
$set: decoratePacket(p.packet, that._opts)
})
} else {
bulk.find(criteria).deleteOne()
}
Expand Down Expand Up @@ -276,9 +278,9 @@ MongoPersistence.prototype.addSubscriptions = function (client, subs, cb) {
bulk.find({
clientId: client.id,
topic: sub.topic
}).upsert().updateOne(
decorateSubscription(subscription, that._opts)
)
}).upsert().updateOne({
$set: decorateSubscription(subscription, that._opts)
})
})

bulk.execute(finish)
Expand Down

0 comments on commit 6ca1ffa

Please sign in to comment.