Creating a new registry from an existing mongo.Client ignores a registry passed in from the DatabaseOptions:
vd := func(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { ... } reg := bson.NewRegistryBuilder(). RegisterDecoder(reflect.TypeOf(custom.JSONTime{}), bsoncodec.ValueDecoderFunc(vd)).Build() db := mongoClient.Database(scoir.Env.DbName, options.Database().SetRegistry(reg))
Looking at the code in database.go shows that the creation of a new database ignores the options and just takes the registry from the client.