Closed JadonKrys closed 7 years ago
Works for me, though we should test if this introduces slowness when on page 1000 :smile:
Not sure there is really a good workaround for high skip values, but maybe they won't happen very often and we can ignore it.
I don't see a issue with high skip values since the lists are accessed by index. So, it isn't slower to access l[10000]
than l[0]
, right?
it's slower because the list doesn't exist until an item is asked for, so it actually has to go back and ask the DB for each item as it iterates/slices.
Ah! Thanks, I didn't know that :)
The
limit
andskip
parameter of theMongo.find_files()
method are ignored because__getitem__
ignores them, see http://api.mongodb.com/python/current/api/pymongo/cursor.html#pymongo.cursor.Cursor.__getitem__As the
start
parameter has been implemented as a list slice, it is already supported. However, thelimit
parameter will be always ignored.The fix could be
for row in result[start : start + end]:...