From 796f7956b807419f707cfb81fe53cfd7c15009d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 9 Oct 2023 15:17:22 +0200 Subject: [PATCH] v0.0.283 --- goextVersion.go | 4 ++-- mongoext/registry.go | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/goextVersion.go b/goextVersion.go index 081227b..f92e951 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.282" +const GoextVersion = "0.0.283" -const GoextVersionTimestamp = "2023-10-09T09:23:40+0200" +const GoextVersionTimestamp = "2023-10-09T15:17:22+0200" diff --git a/mongoext/registry.go b/mongoext/registry.go index c14eb44..9b67579 100644 --- a/mongoext/registry.go +++ b/mongoext/registry.go @@ -3,6 +3,8 @@ package mongoext import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/bsoncodec" + "go.mongodb.org/mongo-driver/bson/bsontype" + "go.mongodb.org/mongo-driver/bson/primitive" "gogs.mikescher.com/BlackForestBytes/goext/rfctime" "reflect" ) @@ -24,5 +26,9 @@ 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() }