from pydantic import BaseModel from pydantic_mongo import AbstractRepository, ObjectIdField class Users(BaseModel): id: ObjectIdField = None username: str class UsersRepository(AbstractRepository[Users]): class Meta: collection_name = users