From d328bc3fbd381b8d8fa66b7a8f006b909ccf3e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= <i.am.the.tablet@proton.me> Date: Thu, 27 Mar 2025 16:02:22 -0400 Subject: [PATCH] fix `time.Time` fields not being saved via adding a special case in the `serializeIDs` function (in document_internals.go) --- document_internals.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/document_internals.go b/document_internals.go index 0b353ba..ae6be4a 100644 --- a/document_internals.go +++ b/document_internals.go @@ -84,7 +84,11 @@ func serializeIDs(input interface{}) interface{} { } } else { - ret0[bbson.Name] = serializeIDs(fv.Interface()) + if fv.Type() == reflect.TypeFor[time.Time]() { + ret0[bbson.Name] = fv.Interface() + } else { + ret0[bbson.Name] = serializeIDs(fv.Interface()) + } } }