Quick Answer
Detect replica inconsistencies with db.runCommand({dbHash: 1}) on each member and compare hashes. Use dbCheck (MongoDB 3.6+) for online validation of data consistency between primary and secondaries. Logical inconsistencies from bugs (application wrote wrong data) can't be fixed by MongoDB - require application-level reconciliation. Always use majority write concern to prevent rollback-induced inconsistencies.
Answer
Use db.hashes(), validate(), and CDC systems to detect mismatches. Fix via initial sync, logical rebuild, or selective re-sync.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
MongoDB interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Perfect for freshers and experienced candidates.