Ai
1 Star 0 Fork 3

源码大数据(codebigdata)/goWebActualCombat

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
mongodb2.go 770 Bytes
Copy Edit Raw Blame History
ShirDon-廖显东 authored 2021-01-19 21:02 +08:00 . commit
//++++++++++++++++++++++++++++++++++++++++
// 《Go Web编程实战派从入门到精通》源码
//++++++++++++++++++++++++++++++++++++++++
// Author:廖显东(ShirDon)
// Blog:https://www.shirdon.com/
// 仓库地址:https://gitee.com/shirdonl/goWebActualCombat
// 仓库地址:https://github.com/shirdonl/goWebActualCombat
//++++++++++++++++++++++++++++++++++++++++
package main
import (
"gitee.com/shirdonl/goWebActualCombat/chapter4/mongodb"
"go.mongodb.org/mongo-driver/mongo"
)
func main() {
var (
client = mongodb.MgoCli()
db *mongo.Database
collection *mongo.Collection
)
//选择数据库 my_db
db = client.Database("my_db")
//选择表 my_collection
collection = db.Collection("my_collection")
collection = collection
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/codebigdata/goWebActualCombat.git
git@gitee.com:codebigdata/goWebActualCombat.git
codebigdata
goWebActualCombat
goWebActualCombat
b84124f40e18

Search