This question already has an answer here:
I followed the link to enable authentication to connect to mongodb. It worked only through mongo shell. However, I could connect successfully to mongodb from Nodejs application using mongoose library WITHOUT applying authentication mechanism. That is , I used connection string as mongodb://localhost/my_db and it connects successfully without specifying username password. Also when I user mongodb://username:password@localhost/pms_db then too connects. I want Nodejs application to connect to mongodb only and only when username and password is specified. How can I achieve this?
via Aditya Achar
No comments:
Post a Comment