Django 开发:PyMongo 或 MongoEngine ...为什么?
尝试在这两者之间做出决定,寻找一些可靠的反馈。谢谢。
Trying to decide between these two, looking for some solid feedback. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MongoEngine 是一个包装 PyMongo.直接使用 PyMongo 可能会稍微更快/更高效。如果您真的喜欢 Django 的 ORM,您可能会喜欢 MongoEngine。查看他们的文档,使用他们的 API,然后自己决定。我比较喜欢两者。您还可以查看 MongoKit,它是另一个包装 PyMongo 的 ORM。这更多的是一个我是否应该使用 ORM 的问题?即使您确实使用 MongoEngine,也请务必阅读 PyMongo 和 MongoDB 的文档!如果您想用 MongoDB 编写像样的应用程序,您仍然需要了解 MongoDB 的工作原理。
MongoEngine is an ORM that wraps PyMongo. Using PyMongo directly will probably be marginally faster/more efficient. If you really like Django's ORM you'll probably like MongoEngine. Look at their documentation, play with their APIs and decide for yourself. I rather like both. You could also take a look at MongoKit which is another ORM that wraps PyMongo. This is more a question of should I use an ORM or not? Even if you do go with MongoEngine, make sure to read PyMongo and MongoDB's documentation! You'll still need to understand how MongoDB works if you want to write decent applications with it.