我试着这样做,但没有奏效.
update := bson.D{{ "$set": bson.D{ "id": "Q" + addr_to_string }, {"$inc": bson.D{ "amount": amount_int } }}}
错误:
mixture of field:value and value elements in struct literal
这是我的初始代码:
update := bson.D{{"$set", bson.D{{"id", "Q" + addr_to_string}, {"amount", amount_int}}}}
我试着增加金额,$Inc..我该怎么做?