mongosh admin --eval 'db.dropUser("app")'

Category: Databases & SQL

mongosh admin --eval 'db.dropUser("app")'

Delete a database user

Removes the app user and all of its roles; clients authenticated as it lose access on their next operation. There is no undo, so confirm with db.getUsers() first.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.