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}}
同一个键的所有操作都需要追加。先谢谢了
有只小跳蛙
相关分类