Answer the question
In order to leave comments, you need to log in
How to remove go.mongodb.org/mongo-driver/bson/primitive.E composite literal uses unkeyed fields?
users.UpdateOne(ctx, bson.M{"username": username}, bson.D{
{"$set", bson.D{{"status", true}}},
})
{"$set", bson.D{{"status", true}}},
Answer the question
In order to leave comments, you need to log in
Here is the solution:
_, err := users.UpdateOne(ctx, bson.M{"username": "kotcich"}, bson.D{
{Key: "$set", Value: bson.D{{Key: "status", Value: true}}},
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question