Files
goext/mongoext/registry.go
T
viktor 26d542c9a2
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m33s
added mongo-driver v2
2026-04-21 18:41:32 +02:00

18 lines
389 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.TypeOf(bson.M{}))
return reg
}