Files
goext/mongoext/registry.go
T
viktor 0c37dd5576
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m27s
updated mongo driver dependencies to v2
2026-04-21 12:11:38 +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
}