In example:
type ExampleType string
type Example struct {
Field []ExampleType
}
myStruct := Example{
Field: []string{"Example"}
}
f := bson.M{
f["MyCollectionField"] = bson.M{"$in": myStruct .Example}
}
This example not working, but if I change my type to string it works
type ExampleType string
type Example struct {
Field []string
}
myStruct := Example{
Field: []string{"Example"}
}
f := bson.M{
f["MyCollectionField"] = bson.M{"$in": myStruct .Example}
}
Should this behavior happen? shouldn’t it be mapped to the primitive type string?