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

db.dropAllRoles() (mongosh 메서드)

db.dropAllRoles( writeConcern )

메서드를 실행하는 데이터베이스에서 모든 사용자 정의 역할을 삭제합니다.

경고

The db.dropAllRoles() method removes all user-defined roles from the database.

중요

Mongo쉬 방법

This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.

데이터베이스 명령에 대해서는 dropAllRolesFromDatabase 명령을 참조하십시오.

MongoDB API 드라이버의 경우 언어별 MongoDB 드라이버 설명서를 참조하세요.

The db.dropAllRoles() method takes the following argument:

필드
유형
설명

writeConcern

문서

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

반환합니다:

삭제 된 사용자 정의 역할의 수입니다.

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

중요

이 명령은 MongoDB Atlas 클러스터에서 지원되지 않습니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.

If run on a replica set, db.dropAllRoles() is executed using "majority" write concern by default.

해당 데이터베이스에서 역할을 삭제하려면 데이터베이스에 대한 dropRole 작업 이 있어야 합니다.

다음 작업은 products 데이터베이스에서 모든 사용자 정의 역할을 삭제하고 majority쓰기 고려 (write concern) 를 사용합니다.

use products
db.dropAllRoles( { w: "majority" } )

이 메서드는 삭제된 역할 수를 반환합니다.

4
이 페이지 평가하기