How can I perform this operation : link
For example I want to get all documents but without field "name":
err := col.Find([]bson.M{{}, {"name": false}}).All(&result)
In result always will be 0 elements, why?(field name exists in collection)
See https://godoc.org/gopkg.in/mgo.v2#Query.Select
You are supposed to use something like:
err := col.Find(nil).Select(bson.M{"name": 0}).All(&result)