## providers.mongodb.migrations.validate_doc()

<span id="hexkit.providers.mongodb.migrations.validate_doc"></span>


Ensure that new content passes model validation.


Usage

``` python
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.
