Re: [go-nuts] MongoDB Connection Failed

2020-04-06 Thread Gregor Best
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

[go-nuts] MongoDB Connection Failed

2020-04-06 Thread Ali Hassan
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.