python - Retrieving an ordered set of Objects from MongoDB | Pymongo -
this first post here. encouraged colleague after searching through part of internet.
i work on project use mongodb , python. web application. defined document class user comments. furthermore have sorted list of ids correspond comments. want access mongodb in order full list of user comment objects directly ordered in order of our list of ids without ordering on fly command orderby (we imagine might save runtime). @ moment use following command:
comment.objects(id__in=ids)
where ids list of sorted ids of comment objects. unfortunately order of list retrieving wrong.
do have hints? or there no way optimize process? thank in advance!
Comments
Post a Comment