Deleting a User
- username is the name of the user to be deleted from the database.
- writeConcern: The level of write concern for the removal operation. This parameter is optional.
Example
The following describes how to delete user reportUser1 from database products.
use products db.dropUser("reportUser1", {w: "majority", wtimeout: 5000})
After the user is deleted, null is displayed when you run the db.getUser command.
replica:PRIMARY> db.getUser("reportUser1") null
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.