I've recently started using the official mongo-go-driver (github.com/mongodb/mongo-go-driver) and it seems that I cannot use pointers in my structs -> ex.:
type example struct {
hello *string
}
If you initialize this struct and try to insert it to the database, you get the error:
"Failed to insert doc: cannot transform type example to a *bsonx.Document"
Diving deeper into the library, I find this error:
"StringEncodeValue can only process string, but got a *string"
Does this mean that pointers can not be used at all? If so, does anyone know why pointers would not be supported?
Using a different type produces the same result. Example error when using an integer type:
"IntEncodeValue can only process int8, int16, int32, int64, int, but got a *int"