I believe document noncompliance should be a warning, not an error, and validate() should return valid:true for a result like:
{u'nNonCompliantDocuments': N, u'errors': [u"Detected one or more documents not compliant with the collection's schema. Check logs for log id 5363500."], u'nrecords': N, u'keysPerIndex': {...}, u'corruptRecords': [], u'advice': u'A corrupt namespace has been detected. See http://dochub.mongodb.org/core/data-recovery for recovery steps.', u'warnings': [], u'indexDetails': {...}, u'valid': False, u'extraIndexEntries': [], u'ok': 1.0, u'nInvalidDocuments': 0, u'ns': u'db.collection', u'repaired': False, u'nIndexes': N, u'missingIndexEntries': []}
In sum, for this failure, I think:
- error should be a warning
- advice should not say "corrupt namespace"
- valid should be true
- related to
-
SERVER-43325 Not all exceptions inside collection validation should result in {valid: false}
- Backlog
-
SERVER-53635 Add document schema validation to validate() command
- Closed