code: func (a AggArray) MarshalJSON() ([]byte, error) {
  	aggsMap := make(map[string]Aggregation)
  
  	for _, subAgg := range a {
  		aggsMap[subAgg.Key] = subAgg.Aggregation
  	}
  
  	return json.Marshal(aggsMap)
  }
docs: // MarshalJSON returns the JSON encoding of the agg