I have a project in laravel 8 where i have integrated mongodb. project is fetching data from 2 databases. for security perpose i have enabled the authorization in mongo.conf.
when i try to fetch data using my local machine i am getting data and mongodb is working as expected but on server i am getting command find requires authentication
i have created user with different roles and access to make it work and i am getting data with mongo shell and mongodb compass but not able to get data with laravel project.
I have verified the values which i am using the values.
I also tried to make it work with mongodb uri but getting the same error
If you are using Laravel ,and all credentials are fine, and you check that you can access the mongodb with a very simple snippet like this:
then maybe your problem is cache. Try this: