https://godoc.org/upper.io/db/mongo
我想操做mongo如何用这个包更新其中的一个字段,func (self *Result) Update(src interface{}) error
这个函数的传参没有看懂 求解
例如 我有一个type Sqltasks struct {
URL string json:"url" db:",json"
Method string json:"method" db:",json"
Cookie string json:"cookie" db:",json"
Body string json:"data" db:",json"
User_agent string json:"user-agent" db:",json"
Status int json:"status" db:",json"
config string json:"tech" db:",json"
}
只想更新其中一条的status 如何实现
有疑问加站长微信联系(非本文作者)

推荐一个我根据mgo封装的这个[https://github.com/golangframework/httpmongo],mgo的常用写法,都可以在代码里找到 (https://github.com/golangframework/httpmongo),支持update() 例如DB.C.update({"name":"张萌萌"},{"$set":{"name":"李萌萌"}})
谢谢