I try to make amount increment, $inc. How can i do this?
Answers
bson.D is to describe a document, an ordered list of properties, where a property is a key-value pair. Properties are described by bson.E which is a simple Go struct holding a Key and Value fields.
So bson.D is a slice of structs, so a bson.D literal must list struct elements also enclosed in {}.
Note that if order doesn't matter (it doesn't matter in this case), it's much more readable and simpler to use bson.M (which is a map) to define your update document: