Search code examples
mongodbmongodb-.net-driver

MongoDB 3.2 - Admin user not authorized to execute command


I have created an admin level user and given the dbAdminAnyDatabase, userAdminAnyDatabase, readWriteAnyDatabase permissions on the admin database as well as my other database and I can create a successful connection to the client but when I try to run a command to retreive data I get an error saying 'Command find failed: not authorized on {database} to execute command'.

Any ideas on why this isn't working?


Solution

  • I found an example where the user was made to have "root" access and now I can successfully query data. The question still remains why the above credentials didn't work.