Hi Ali,
it looks like there's nothing listening on localhost port 27017. Maybe
the mongod log has some more information for you.
On 06.04.20 15:28, Ali Hassan wrote:
clientOptions
:=options.Client().ApplyURI("mongodb://localhost:27017")// Connect to
MongoDBclient,err :=mongo.Connect(context.TODO(),clientOptions)iferr
!=nil{log.Fatal(err)}// Check the connectionerr
=client.Ping(context.TODO(),nil)iferr
!=nil{log.Fatal(err)}fmt.Println("Connected to MongoDB!")
Error receive when i execute my programCapture.JPG
--
You received this message because you are subscribed to the Google
Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to golang-nuts+unsubscr...@googlegroups.com
<mailto:golang-nuts+unsubscr...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/bfd30b79-343e-48cc-b853-1d42fe9cd825%40googlegroups.com
<https://groups.google.com/d/msgid/golang-nuts/bfd30b79-343e-48cc-b853-1d42fe9cd825%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
--
Gregor Best
b...@pferdewetten.de
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/b2c233d3-c7cb-8c69-4808-fca75d818403%40pferdewetten.de.