소스 클러스터 쿼리 하고 문서, 인덱스, 컬렉션, 메타데이터 및 뷰를 대상 클러스터 와 비교하는 스크립트 쓰기 (write) 수 있습니다.
문서 비교
소스 클러스터와 대상 클러스터의 문서를 비교하여 동기화 확인할 수 있습니다.
이 메서드로 데이터 전송 확인하려면 먼저 mongosync 가 COMMITTED 상태 여야 합니다.
인덱스 비교
To verify the transfer of indexes, run db.collection.getIndexes() on the source and destination clusters and compare the results.
메타데이터 비교
To verify the transfer of metadata, run db.getCollectionInfos() on the source and destination clusters and compare the results.
샤드 키 비교
동기화된 컬렉션 으로의 샤드 키 전송을 확인하려면 config.collections 컬렉션 에서 쿼리 실행 _id 값이 대상 컬렉션 의 네임스페이스 인 문서 찾습니다. 소스 및 대상 클러스터에서 이 문서 의 key 값을 비교합니다.
For example, for a collection named pets in the records database, you can verify the shard key using the following query in mongosh:
db.getSiblingDB("config").collections.find({ _id : "records.pets" })