The read and readWrite built-in roles can be applied to the database in use or to the database designated specifically when creating a user. Here is a summary of these two roles:
- readAnyDatabase: The readAnyDatabase built-in role grants the same rights as the read database right described earlier to all databases except for local and config, which are reserved internally used databases. If the user also needs rights to either of these, use the admin database, and make a specific read assignment to either one as appropriate.
- readWriteAnyDatabase: The readWriteAnyDatabase built-in role grants the same rights as the readWrite database right to all databases except for local and config, which are reserved internally used databases. If the user also needs rights to either of these, use the admin database, and make a specific readWrite assignment to either one as appropriate.
The next subsection looks at how to create a user with all database...