From a8e2cc11af177641409ff7726ed8c4f1a154dee4 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 23 Feb 2021 10:15:09 -0500 Subject: [PATCH 1/2] fix: removes overwrite from update operation --- src/collections/operations/update.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collections/operations/update.ts b/src/collections/operations/update.ts index 1f64b2344b..3717e32111 100644 --- a/src/collections/operations/update.ts +++ b/src/collections/operations/update.ts @@ -257,7 +257,7 @@ async function update(incomingArgs: Arguments): Promise { result = await Model.findByIdAndUpdate( { _id: id }, result, - { overwrite: true, new: true }, + { new: true }, ); result = result.toJSON({ virtuals: true }); From 40f59015269c1954103441cb666fdeaa67c38388 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 23 Feb 2021 10:38:56 -0500 Subject: [PATCH 2/2] fix: forces depth to 0 in update operation --- src/collections/operations/update.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collections/operations/update.ts b/src/collections/operations/update.ts index 3717e32111..e87fbc9579 100644 --- a/src/collections/operations/update.ts +++ b/src/collections/operations/update.ts @@ -107,7 +107,7 @@ async function update(incomingArgs: Arguments): Promise { docWithLocales = JSON.parse(docWithLocales); const originalDoc = await performFieldOperations(collectionConfig, { - depth, + depth: 0, req, data: docWithLocales, hook: 'afterRead',