Hi there, I’m using M10 cluster and trying to dynamically update user info with mongoose with this code snipped:
const client = new MongoClient(DB_URI)
await client.db('admin').command(
{
updateUser: username,
pwd: newPassword,
}
);
but unfortunally I’m getting an error: errmsg: 'not authorized on admin to execute command { updateUser: "myuser", pwd: "xxx", $db: "admin" }',
any ideas how to do that?