motorhead.model.document
BaseDocument
Bases: BaseModel
Pydantic BaseModel
for documents, embedded documents, and related models.
It's just a convenience class that adds a default Pydantic ConfigDict
with the
necessary settings to enable custom types (e.g. ObjectId
) and population by name
in subclasses, so you don't have to set these settings yourself.
Source code in motorhead/model/document.py
Document
Bases: BaseDocument
Pydantic base model for MongoDB documents.
It exposes the _id
attribute as id
.