I am using a ExtJS frontend and for a back end I'm using django, mongodb, and mongoengine (ORM - between the two). Everything works until i decide to shard m开发者_开发技巧y mongo database, turns out db.eval() (uses datbase to run commands) doesn't work with a sharded database. So I have to switch out the ORM.
I found several other ORMS such as mongokit and mongoalchemy, however I do not want to go through each individual ORM and hope that it works after changing all the commands from the recent ORM to the new one. Does anyone know a Mongo ORM that doesn't use db.eval() or works with a sharded mongo database?
Thank you
MongoEngine has now been updated not to use db.eval
for the 2 areas that used it where map_reduce should have been used: sum
and average
. item_frequencies
has been updated to default to using map_reduce over using exec_js & db.eval
.
In the end it was a small update: https://github.com/hmarr/mongoengine/pull/256/files thanks to @dcrosta for the patch and letting me know this thread existed!
You can grab the latest shard happy code from the dev branch https://github.com/hmarr/mongoengine/tree/dev
Dont forget theres a mailing list for monogoengine - http://groups.google.com/group/mongoengine-users for any comments / issues or feedback and theres #mongoengine on irc
Cheers,
Ross
精彩评论