providers.mongodb.migrations.validate_doc()
Ensure that new content passes model validation.
Usage
providers.mongodb.migrations.validate_doc(
doc,
*,
model,
id_field,
)Also check that dto_to_document results in the same document.
Raises: - ValidationError: If the doc cannot be used to populate the model. - RuntimeError: If the model can be populated, but there’s a mismatch.