중요
Mongo쉬 방법
This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.
데이터베이스 명령에 대해서는 reIndex 명령을 참조하십시오.
MongoDB API 드라이버의 경우 언어별 MongoDB 드라이버 설명서를 참조하세요.
정의
db.collection.reIndex()버전 6.0부터 더 이상 사용되지 않습니다.
Attempting to run the
db.collection.reIndex()method writes a warning message to the log.The
db.collection.reIndex()drops all indexes on a collection and recreates them. This operation may be expensive for collections that have a large amount of data and/or a large number of indexes.경고
db.collection.reIndex()may only be run on standalone instances.For most users, the
db.collection.reIndex()command is unnecessary.
호환성
이 메서드는 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
중요
이 명령은 MongoDB Atlas 클러스터에서 지원되지 않습니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.
행동
For MongoDB 5.0 or later, db.collection.reIndex() may only be run on standalone instances.
리소스 잠금
db.collection.reIndex() 컬렉션에 대한 배타적(W) 잠금을 획득하고 완료될 때까지 컬렉션에 대한 다른 작업을 차단합니다.
MongoDB 잠금에 대한 자세한 내용은 FAQ: 동시성을 참조하세요.