AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

dropAllUsersFromDatabase(데이터베이스 명령)

dropAllUsersFromDatabase

명령을 실행하는 데이터베이스에서 모든 사용자를 제거합니다.

팁

In mongosh, this command can also be run through the db.dropAllUsers() helper method.

Helper methods are convenient for mongosh users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.

경고

The dropAllUsersFromDatabase removes all users from the database.

이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

중요

This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.

명령은 다음과 같은 구문을 가집니다:

db.runCommand(
{
dropAllUsersFromDatabase: 1,
writeConcern: { <write concern> },
comment: <any>
}
)

이 명령은 다음 필드를 사용합니다.

필드
유형
설명

dropAllUsersFromDatabase

integer

현재 데이터베이스에서 모든 사용자를 삭제하려면 1 을 지정합니다.

writeConcern

문서

선택 사항입니다. 작업에 대한 쓰기 고려 수준입니다. 쓰기 고려 사양을 참조하세요.

comment

any

선택 사항. 이 명령에 첨부할 사용자 제공 코멘트입니다. 설정되면 이 설명은 다음 위치에서 이 명령의 레코드와 함께 표시됩니다.

댓글은 유효한 모든 BSON types (문자열, 정수, 객체, 배열 등)이 될 수 있습니다.

해당 데이터베이스에서 사용자를 제거하려면 데이터베이스에 dropUser 조치가 있어야 합니다.

The following sequence of operations in mongosh drops every user from the products database:

use products
db.runCommand( { dropAllUsersFromDatabase: 1, writeConcern: { w: "majority" } } )

결과 문서의 n 필드에는 제거된 사용자 수가 표시됩니다.

{ "n" : 12, "ok" : 1 }