mongodb grant user roles for db code example Example: mongo grant role tu user db.grantRolesToUser("admin", [{role: "readWrite", db: "local"}]);