Hi Priya,
MongoDB provides the built-in database user and database administration roles on every database. The other built-in roles such as cluster administration, backup and restoration and all-database roles are only available on the admin database. See built-in roles for more details.
As per your example, you could modify testdb into admin:
db.grantRolesToUser("test123", [ { role: "clusterAdmin", db: "admin" } ])
You may also find Manage user and roles a useful read.
Kind regards,
Wan.