PyMongo vs MongoEngine for Django

前端 未结 4 1159
清酒与你
清酒与你 2021-01-31 15:39

For one of my projects I prefered using Django+Mongo.

Why should I use MongoEngine, but not just PyMongo? What are adv

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-31 16:32

    I assume you have not read the MongoEngine claim.

    MongoEngine is a Document-Object Mapper (think ORM, but for document databases) for working with MongoDB from Python.

    This basically say it all.

    In addition: your claim that Pymongo would deliver objects is wrong....well in Python everything is an object - even a dict is an object...so you are true but not in the sense of having a custom class defined on the application level.

    PyMongo is the low-level driver wrapping the MongoDB API into Python and delivering JSON in and out.

    MongoEngine or other layers like MongoKit map your MongoDB-based data to objects similar to native Python database drivers + SQLAlchemy as ORM.

提交回复
热议问题