diff --git a/pydantic_mongo/abstract_repository.py b/pydantic_mongo/abstract_repository.py index 233e634..bfa307d 100644 --- a/pydantic_mongo/abstract_repository.py +++ b/pydantic_mongo/abstract_repository.py @@ -71,6 +71,8 @@ def to_document(model: T) -> dict: data.pop("id") if model.id: data["_id"] = model.id + if model.v: + data["__v"] = model.v return data def __map_id(self, data: dict) -> dict: