From b808c5727c83b61d2a362c2aec6b24bd700b755e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 9 Oct 2023 15:22:57 +0200 Subject: [PATCH] v0.0.284 --- goextVersion.go | 4 ++-- mongoext/registry.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/goextVersion.go b/goextVersion.go index f92e951..3ada5b5 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.283" +const GoextVersion = "0.0.284" -const GoextVersionTimestamp = "2023-10-09T15:17:22+0200" +const GoextVersionTimestamp = "2023-10-09T15:22:57+0200" diff --git a/mongoext/registry.go b/mongoext/registry.go index 9b67579..08a0169 100644 --- a/mongoext/registry.go +++ b/mongoext/registry.go @@ -12,6 +12,10 @@ import ( func CreateGoExtBsonRegistry() *bsoncodec.Registry { rb := bsoncodec.NewRegistryBuilder() + // otherwise we get []primitve.E when unmarshalling into any + // which will result in {'key': .., 'value': ...}[] json when json-marshalling + rb.RegisterTypeMapEntry(bsontype.EmbeddedDocument, reflect.TypeOf(primitive.M{})) + rb.RegisterTypeDecoder(reflect.TypeOf(rfctime.RFC3339Time{}), rfctime.RFC3339Time{}) rb.RegisterTypeDecoder(reflect.TypeOf(&rfctime.RFC3339Time{}), rfctime.RFC3339Time{}) @@ -26,9 +30,5 @@ func CreateGoExtBsonRegistry() *bsoncodec.Registry { bson.PrimitiveCodecs{}.RegisterPrimitiveCodecs(rb) - // otherwise we get []primitve.E when unmarshalling into any - // which will result in {'key': .., 'value': ...}[] json when json-marshalling - rb.RegisterTypeMapEntry(bsontype.EmbeddedDocument, reflect.TypeOf(primitive.M{})) - return rb.Build() }