I want to update several fields without doing the command several times in mongodb using Go and the "go.mongodb.org/mongo-driver" driver. Currently doing:
singleResult := collection.FindOneAndUpdate(ctx, bson.M{"mid": MID}, bson.M{"$inc": bson.M{eval: 1}})
singleResult = collection.FindOneAndUpdate(ctx, bson.M{"mid": MID}, bson.M{"$push": bson.M{eval + "uids": UID}})
I tried several things such as doing an array of primitive.D or a bson.D. I think I'm not really understanding how it works. I also tried using Collection.Aggregation() but did not quite get it to work. I assume this should be easy and I might be going over some concept.
tl;dr: How to send an array of updates to FindOneAndUpdate function from mongo-driver on Golang ?