From 656c055a1f80aaf1262c27b531e133897b4d2c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20G=C3=A4hwiler?= Date: Mon, 27 Nov 2023 13:50:21 +0100 Subject: [PATCH] coal: added note --- coal/helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coal/helpers.go b/coal/helpers.go index 6529ab02..1bb677c9 100644 --- a/coal/helpers.go +++ b/coal/helpers.go @@ -160,6 +160,10 @@ func ReverseSort(sort []string) []string { } // Apply will apply the provided update document to the specified model. +// +// Note: The update operator "$unset" will not work as expected on structs, +// because the fields will not be set to their zero values. Use the "$set" +// operator instead. func Apply(model Model, update bson.M) error { // skip if update is empty if len(update) == 0 {