在具有明确排除字段的数据库中查找

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)