정의
db.dropAllUsers(writeConcern)현재 데이터베이스에서 모든 사용자를 제거합니다.
중요
Mongo쉬 방법
This page documents a
mongoshmethod. This is not the documentation for database commands or language-specific drivers, such as Node.js.데이터베이스 명령에 대해서는
dropAllUsersFromDatabase명령을 참조하십시오.MongoDB API 드라이버의 경우 언어별 MongoDB 드라이버 설명서를 참조하세요.
경고
The
db.dropAllUsers()method removes all users from the database.The
db.dropAllUsers()method takes the following arguments:The
db.dropAllUsers()method wraps thedropAllUsersFromDatabasecommand.
호환성
이 메서드는 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
중요
이 명령은 MongoDB Atlas 클러스터에서 지원되지 않습니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
행동
복제본 세트
If run on a replica set, db.dropAllUsers() is executed using "majority" write concern by default.
필요한 액세스 권한
예시
The following db.dropAllUsers() operation drops every user from the products database.
use products db.dropAllUsers( {w: "majority", wtimeout: 5000} )
결과 문서의 n 필드에는 제거된 사용자 수가 표시됩니다.
{ "n" : 12, "ok" : 1 }