Error receive when i execute my program
Hi Ali,
it looks like there's nothing listening on localhost port 27017.
Maybe the mongod log has some more information for you.
clientOptions := options.Client().ApplyURI("mongodb://localhost:27017") // Connect to MongoDB client, err := mongo.Connect(context.TODO(), clientOptions) if err != nil { log.Fatal(err) } // Check the connection err = client.Ping(context.TODO(), nil) if err != nil { log.Fatal(err) } fmt.Println("Connected to MongoDB!")
Error receive when i execute my program
--
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...@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.
-- -- Gregor Best be...@pferdewetten.de