lstMap := make([]interface{}, 0)
lstMap = mongoOps.AddToBsonMap(lstMap, bson.M{"$inc": bson.M{"Google.ab.Value": 1}})
lstMap = mongoOps.AddToBsonMap(lstMap, bson.M{"$inc": bson.M{"Google.ab1.Value1": 1}})
func (o *MongoOps) AddToBsonMap(lstMap []interface{}, value interface{}) (result []interface{}) {
lstMap = append(lstMap, value)
return lstMap
}
I want the in this format :
bson.M{"$inc": bson.M{"Google.ab.Value": 1, "AB.Value.to": 2}}
All the operation of same key needs to be appended.Thank you in advance