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.
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(