I noticed that saving the models also creates an empty id in both the _doc attribute for DBPydanticMixin instance and the MongoDB collection. Also, if you call the dict() method on the model, this field will be included in the result. This is especially noticeable with nested models. But just comparing 2 models - everything will be fine.
I noticed that saving the models also creates an empty
id
in both the_doc
attribute forDBPydanticMixin
instance and the MongoDB collection. Also, if you call thedict()
method on the model, this field will be included in the result. This is especially noticeable with nested models. But just comparing 2 models - everything will be fine.This is not entirely good.
Mini-prof from test breakpoint
```python (ipdb>) debug(post, post.dict())Environment:
Python - 3.8 motor - 2.1.0 pymongo - 3.10.1 pydantic - 1.6.1 pydantic-odm - 0.2