I have been trying to run my project on an AWS EC2 instance.
I have a Ubuntu instance, and on this, I tried using MongoDB as my database but as soon as I insert a document in it, it shows an error, not locally on my personal system but on this ubuntu.
Though it gets connected successfully.
I have used the official MongoDB driver.
“My connection string.”
clientOptions := options.Client().ApplyURI("mongodb://localhost:27017")
The error :(Unauthorized) command insert requires authentication 2020/03/12 16:08:40 HTTP: panic serving 220.127.116.11:51744: runtime error: invalid memory address or nil pointer dereference
Help me with this, please.