sql >> Base de Datos >  >> NoSQL >> MongoDB

¿MongoDB ORM para Python?

Otra opción es MongoEngine . El ORM de MongoEngine es muy similar al ORM utilizado por Django.

Ejemplo (del tutorial):

class Post(Document):
    title = StringField(max_length=120, required=True)
    author = ReferenceField(User)

class TextPost(Post):
    content = StringField()

class ImagePost(Post):
    image_path = StringField()

class LinkPost(Post):
    link_url = StringField()