Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func M ¶
使用示例
定义一个接收器 oneData := make(map[string]interface{}) 每执行一个M函数都从连接池拷贝一个连接,闭包内有集合collection的操作句柄实例,直接在闭包里mongo操作 M("student", func(collection *mgo.Collection) { err := collection.FindId(bson.ObjectIdHex("5c8608a7baa5203fc198859f")).One(&oneData) ErrorHandler(err, "Find().One()") fmt.Println("查询一个结果:", oneData) })
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.