정의
버전 7.0의 새로운 기능: ( 6.0.7부터 사용 가능)
Deletes an existing MongoDB Search index or MongoDB Vector Search index.
중요
Mongo쉬 방법
This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.
데이터베이스 명령에 대해서는 dropSearchIndex 명령을 참조하십시오.
MongoDB API 드라이버의 경우 언어별 MongoDB 드라이버 설명서를 참조하세요.
호환성
이 메서드는 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
MongoDB Enterprise 버전 8.2 이상을 실행하는 Kubernetes 연산자배포서버
버전 이상 실행MongoDB Community 배포 8.2
자체 관리형 배포에 대해 자세히 학습 자체 관리형 배포에 대한 MongoDB 검색을 참조하세요.
구문
명령 구문:
db.<collection>.dropSearchIndex(<name>)
명령 필드
dropSearchIndex() 는 다음 필드를 사용합니다.
필드 | 유형 | 필요성 | 설명 |
|---|---|---|---|
| 문자열 | 필수 사항 | 삭제할 검색 인덱스의 이름입니다. |
행동
dropSearchIndex() 를 실행한 후 명령에서 응답을 받은 시점과 인덱스가 삭제된 시점 사이에 지연이 있을 수 있습니다.
검색 인덱스의 상태를 확인하려면 $listSearchIndexes 집계 단계를 사용합니다. 인덱스가 삭제되면 해당 인덱스는 더 이상 $listSearchIndexes 출력에 나타나지 않습니다.
액세스 제어
배포에서 액세스 제어를 적용하는 경우 dropSearchIndex() 메서드를 실행하는 사용자에게는 데이터베이스에 대한 dropSearchIndex 권한 조치가 있어야 합니다.
{ resource: { database : true }, actions: [ "dropSearchIndex" ] }
기본 제공 dbAdmin 및 readWrite 역할은 dropSearchIndex 권한을 제공합니다. 다음 예에서는 qa 데이터베이스에 readWrite 역할을 부여합니다.
db.grantRolesToUser( "<user>", [ { role: "readWrite", db: "qa" } ] )
예시
다음 예에서는 searchIndex01 movies collection에서 이)라는 검색 인덱스를 삭제합니다.
db.movies.dropSearchIndex("searchIndex01")