How can we indicate a specific version of the go driver to download

Hi,
How do we indicate which version of the go driver to download

the command provided in the documentation is downloading the latest driver (1.5.1):

go get go.mongodb.org/mongo-driver/mongo

How can I download an earlier version ?

thanks

Hi @Dror_Mikdash1, and welcome to the forums!

If you have Golang version 1.11+, you can use go mod. For example within your project directory you could perform:

go mod init 
go get -d -v go.mongodb.org/mongo-driver@v1.5.0
go build 

The first command above will create a new go.mod file in the project that act as a dependency manifest.

Regards,
Wan.

2 Likes