db = db.getSiblingDB("user"); db.createUser({ user: "useradmin", pwd: "userpassword", roles: [ { role: "dbOwner", db: "registration", }, ], }); print("Database 'user' and admin user created successfully.");