I have a document in mongodb in this format,
{
field1: string,
field2: float64,
field3: {...float64}
}
Ultimately I would like to always get field1 & field2 and pick/choose from the field3 object.
To do it, I decode the data into a struct like this,
type MongoScore struct {
field1 string `json:"field1"`
field2 float64 `json:"field2"`
field3 map[string]float64 `json:"field3"`
}
The part I am wondering is whether there is a more efficient approach to pull this data with different types.