Connect Go driver with MongoDB
for gin
git clone https://github.com/vinodnextcoder/go-mongo-server.git
you go directory install package and run code
cd go-mongo-server
Install Gin:
go get github.com/gin-gonic/gin
go get go.mongodb.org/mongo-driver/mongo
go get github.com/joho/godotenv
go get github.com/swaggo/files
go get github.com/swaggo/gin-swagger
go install github.com/swaggo/swag/cmd/swag@latest
swag init
You can run your Gin web application by executing the main.go file:
go run main.go
from go-mongo-server/postman_collection
http://localhost:3000
http://localhost:3001/swagger/index.html