Files
goext/mongoext/registry.go
T
viktor 852468f976 updated mongo driver dependencies to v2
# Conflicts:
#	exerr/constructor.go
#	exerr/dataCategory.go
#	exerr/dataSeverity.go
#	exerr/dataType.go
#	exerr/exerr.go
#	go.mod
#	mongoext/registry.go
#	reflectext/primStrSer.go
#	rfctime/date.go
#	rfctime/rfc3339.go
#	rfctime/rfc3339Nano.go
#	rfctime/seconds.go
#	rfctime/unix.go
#	rfctime/unixMilli.go
#	rfctime/unixNano.go
#	wmo/collection.go
#	wmo/queryInsert.go
2026-04-21 17:07:02 +02:00

18 lines
390 B
Go

package mongoext
import (
"reflect"
"go.mongodb.org/mongo-driver/v2/bson"
)
func CreateGoExtBsonRegistry() *bson.Registry {
reg := bson.NewRegistry()
// otherwise we get []bson.E when unmarshalling into any
// which will result in {'key': .., 'value': ...}[] json when json-marshalling
reg.RegisterTypeMapEntry(bson.TypeEmbeddedDocument, reflect.TypeFor[bson.M]())
return reg
}