## providers.mongodb.migrations.check_db_version()

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


Verify that the database is at `target_version`, raising an error if not.


Usage

``` python
providers.mongodb.migrations.check_db_version(
    *,
    config,
    target_version,
)
```


This function can be used to verify DB state separately from the core migration logic.

Raises: - [DbVersionMismatchError](providers.mongodb.migrations.DbVersionMismatchError.md#hexkit.providers.mongodb.migrations.DbVersionMismatchError): If the current DB version doesn't match `target_version`.
