mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-21 01:23:09 -07:00
Replace deprecated update() with updateOne()
This commit is contained in:
parent
046a213e41
commit
869e01f455
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue