Authentication failure via API and Compass

Users are created in the current database. When you connect with mongo and mongosh the current database is test. To create the users in the admin you have to run the command use admin first.

The course M103 from MongoDB University covers some of the aspects and M150 goes a little bit further.

1 Like