Golang And MongoDB REST API
Create a new Golang project:
go mod init (name-here i.e go mod init github.com/atique22/golang-mongodb-project)
Install necessary Go packages:
We will need to install some packages to connect to MongoDB and build our REST API. Run the following command to install these packages:
go get go.mongodb.org/mongo-driver/mongo
go get -u github.com/gorilla/mux
run server
go run *go