project_mern_memories
project_mern_memories copied to clipboard
error while connecting to db
[email protected] start C:\Users\Mara\Desktop\MEMORIES_PROJECT\server nodemon index.js
[nodemon] 2.0.7
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node index.js
(node:5772) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use node --trace-warnings ...
to show where the warning was created)
bad auth : Authentication failed.
on server side inside root index.js line no. 17
const CONNECTION_URL = 'mongodb+srv://js_mastery:[email protected]/test';
You make sure you're using your own MongoDB Connection URL String
or if you don't how to do it, check out this tutorial video of this code Click Here.
Specifically, MongoDB Setup Starts at 10:21mint.
If you use your own MongoDB Connection URL String perfectly then there will be no Error of bad auth : Authentication failed.
(node:8820) [MONGODB DRIVER] Warning: the options [useNewUrlParse] is not supported
(Use node --trace-warnings ...
to show where the warning was created)
(node:8820) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
(node:8820) [MONGODB DRIVER] Warning: Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
error.message
what to do?
@2sajib2
yes, I got the error. bad auth: Authentication failed
I used my own MongoDB connection URL.
How can I fix this?