Replace deprecated update() with updateOne()

This commit is contained in:
Tony Whalen 2023-04-06 01:24:41 -07:00
commit 869e01f455

View file

@ -97,15 +97,17 @@ class MongoDocumentStore extends Store {
return client
?.db()
.collection('entries')
.update(
.updateOne(
{
entry_id: key,
$or: [{ expiration: -1 }, { expiration: { $gt: now } }]
},
{
entry_id: key,
value: data,
expiration: this.expire && !skipExpire ? this.expire + now : -1
$set: {
entry_id: key,
value: data,
expiration: this.expire && !skipExpire ? this.expire + now : -1
}
},
{
upsert: true