Motor-ODM is a modern async Object-Document-Mapper for MongoDB. It is based on Pydantic and Motor. It exclusively works with asyncio
.
If you are using Pydantic for more than your ODM (e.g. when using FastAPI and want to use the bson.ObjectId <bson.objectid.ObjectId>
class you need to tell Pydantic how to handle this class. You can either do this manually or use the handlers from Motor-ODM. To do so all you need to do is make sure that motor_odm.document
is imported before you define your Pydantic models that use ObjectId <bson.objectid.ObjectId>
.
Motor-ODM consists of several modules and classes all of which are documented in the full API reference <reference/motor_odm>
. This section highlights some classes in order to give you an overview where to start.
motor_odm.document.Document
Motor-ODM Documentation <self> API Reference <reference/motor_odm> genindex