From 11caefb6db79b92acdacdfa9ea955c79f0987585 Mon Sep 17 00:00:00 2001 From: Awesome-E <54484616+Awesome-E@users.noreply.github.com> Date: Sun, 8 Sep 2024 02:24:50 -0700 Subject: [PATCH] Allow new and updates --- src/modules/database.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/database.js b/src/modules/database.js index 72f4897..76d1c85 100644 --- a/src/modules/database.js +++ b/src/modules/database.js @@ -26,7 +26,7 @@ const serverSettingsDB = { put: async function (data) { const id = data.key delete data.key - await ServerSettings.findByIdAndUpdate(id, data) + await ServerSettings.findByIdAndUpdate(id, data, { new: true, upsert: true }) } }