What is the "admin" database in mongodb?

Micawber picture Micawber · Jan 14, 2018 · Viewed 9.8k times · Source

I was practicing ont mongodb documentation : https://docs.mongodb.com/manual/tutorial/enable-authentication/

and I can't figure out if the "admin" database in the example is just a database created for the tutorial or if it is a built-in database made specifically for managing admin users.

Thanks in advance.

Answer

Sushant Pimple picture Sushant Pimple · Jan 14, 2018

The main purpose of this admin database is to store system collections and user authentication and authorization data, which includes the administrator and user's usernames, passwords, and roles. Access is limited to only to administrators, who have the ability to create, update, and delete users and assign roles.