From 869e01f455b9934086467223828d4fdf8ef30d05 Mon Sep 17 00:00:00 2001 From: Tony Whalen Date: Thu, 6 Apr 2023 01:24:41 -0700 Subject: [PATCH] Replace deprecated update() with updateOne() --- src/lib/document-stores/mongo.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/document-stores/mongo.ts b/src/lib/document-stores/mongo.ts index 795accd..fca207e 100644 --- a/src/lib/document-stores/mongo.ts +++ b/src/lib/document-stores/mongo.ts @@ -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