Is it possible to have a method that takes as input an array of strings and then use this array to create the selected fields of a query? So if you have lets say this array:
var myArray []string{"fieldA","fieldB"}
Then you can create this automatically:
selectedFields := bson.M{"fieldA": 1, "fieldB": 1}
and then execute the query
result = c.Find(query).Select(selectedFields).One()