0

I am able to connect to mongodb using mongoose library in nodejs.

mongoose.connect(URL, mongoConfig);

This code is working on local but it shows following error in k8s server.

"ok": 0,
"code": 13,
"codeName": "Unauthorized"
NoobDeveloper
  • 49
  • 1
  • 5
  • Maybe this one: https://stackoverflow.com/questions/63754742/authentication-failure-while-trying-to-save-to-mongodb/63755470#63755470 – Wernfried Domscheit Jan 02 '23 at 18:29
  • Is authentication enabled in the local server? enableLocalhostAuthBypass is enabled by default, so if no users have been created, connections from localhost will be authorized without authenticating. – Joe Jan 02 '23 at 21:07

0 Answers0