I'm follow this guide to setting up an app with a data base (https://www.mongodb.com/languages/mern-stack-tutorial).
I'm at the step where I have everything installed and an Atlas account set up. I'm trying to connect to my database from VS Code but every time I try it it gives me this
code: 8000,
codeName: 'AtlasError',
connectionGeneration: 0,
[Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }
All the links that I have looked for related issues on AtlasError or error code 8000s would tell me to not include the <> that is put in with the and in the Atlas URI
mongodb+srv://<username>:<password>@sandbox.jadwj.mongodb.net/employees?retryWrites=true&w=majority
. Other suggestions have been to use the username and password that has access to the database rather than the account which have been made certain of.
I tried looking up error labels in the documentation but I don't see anything.
This is the whole output.
Server is running on port: 5000
MongoServerError: bad auth : Authentication failed.
at Connection.onMessage (C:\Users\Alexander Chea\Desktop\Starz\mern\server\node_modules\mongodb\lib\cmap\connection.js:227:30)
at MessageStream.<anonymous> (C:\Users\Alexander Chea\Desktop\Starz\mern\server\node_modules\mongodb\lib\cmap\connection.js:60:60)
at MessageStream.emit (node:events:513:28)
at processIncomingData (C:\Users\Alexander Chea\Desktop\Starz\mern\server\node_modules\mongodb\lib\cmap\message_stream.js:125:16)
at MessageStream._write (C:\Users\Alexander Chea\Desktop\Starz\mern\server\node_modules\mongodb\lib\cmap\message_stream.js:33:9)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
at TLSSocket.ondata (node:internal/streams/readable:766:22)
at TLSSocket.emit (node:events:513:28) {
ok: 0,
code: 8000,
codeName: 'AtlasError',
connectionGeneration: 0,
[Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }
}
Any help would be appreciated, thanks.