I am new to MongoDB Atlas and am having trouble connecting Lumen with the mongoDB atlas cluster. the error message I received was Authentication failed.
the code I use to connect is as follows:
'mongodb_atlas' => [
'driver' => 'mongodb',
'dsn' => 'mongodb+srv://myusername:mypassword@mycluster.99xxx.mongodb.net/mydbname?retryWrites=true&w=majority',
'database' => 'mydbname',
]
even though the username and password that I entered in dsn match those in MongoDB Atlas. is there something wrong with my code? how is the solution? I am very grateful if anyone can help.
note:
Lumen that I use version 8.x, and PHP version 8.x
