mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-21 04: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
|
return client
|
||||||
?.db()
|
?.db()
|
||||||
.collection('entries')
|
.collection('entries')
|
||||||
.update(
|
.updateOne(
|
||||||
{
|
{
|
||||||
entry_id: key,
|
entry_id: key,
|
||||||
$or: [{ expiration: -1 }, { expiration: { $gt: now } }]
|
$or: [{ expiration: -1 }, { expiration: { $gt: now } }]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry_id: key,
|
$set: {
|
||||||
value: data,
|
entry_id: key,
|
||||||
expiration: this.expire && !skipExpire ? this.expire + now : -1
|
value: data,
|
||||||
|
expiration: this.expire && !skipExpire ? this.expire + now : -1
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
upsert: true
|
upsert: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue