import mongoz
database_uri = "mongodb://localhost:27017"
registry = mongoz.Registry(database_uri)
class User(mongoz.Document):
name: str = mongoz.String(max_length=255)
age: int = mongoz.Integer()
is_active: bool = mongoz.Boolean(default=True)
class Meta:
registry = registry
database = "my_db"
With clear syntax, declaring models was never so easy.
100% Pydantic allowig you to take advantage of validations.
With familiar interface built on the top of Motor.
Although built on the top of Motor and PyMongo, Mongoz with its familiar and friendly interface makes it easy and pleasant to work with.
Define documents in a clear and intuitive way without extra hurdle.
Define Pydantic models inside documents and store them with ease and seemlessly.
Using the manager or que queryset.
Listen to any event triggered by a model operation.
Mongoz is open source and free to use but also needs enthusiastic people willing to help by contributing in any way, so you will be always welcomed to join.