Help Center/
Document Database Service/
FAQs/
Database Permissions/
User Management/
Deleting a User
Updated on 2024-04-29 GMT+08:00
Deleting a User
db.dropUser(username, writeConcern)
- 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
Parent topic: User Management
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot