mongodb – using mongdb in docker with Go-ThrowExceptions

Exception or error:

i tried to run MongoDB in docker-compose and connect my Go server with MongoDB in docker seem not to work for me, thought i already use mongodb:MyContanerName:27017

when i run my go server and then i tired to request on my client, the error something like this

2019/09/08 14:10:37 Unexpected error: rpc error: code = Internal desc = internal error: server selection error: server selection timeout
current topology: Type: Unknown
Addr: mongo:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection(mongo:27017[-125]) connection is closed

i already did docker-compose up -d for my docker, and it was running on my docker ,

the full code is trigger here golang and mongodb

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *