Original post

type UserMessage struct {
ID primitive.ObjectID json:"id,omitempty" bson:"_id,omitempty"
Data DataType json:"data" bson:"data"

type DataType struct{
Details []DetailsData json:"details" bson:"details"

type DetailsData struct{
Name string json:"name" bson:"name"
Value []interface{} json:"value" bson:"value"

Sample data

I tried unmarshal by setup the DetailsData with interface{} and array of interface{}. Interface{} fails with value is just a string and [] interface{} fails to unmarshal when value is not an array.