Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a_result = []
- toSort = [('_id', 1)]
- number = 20000
- cursor = collectionObject.find(conditions,timeOut = False).sort(toSort).limit(number)
- if cursor!= None and cursor.count() >0 and cursor.alive:
- for i in range(number):
- if cursor and cursor.alive:
- record = cursor.next(cursor,None)
- if record:
- a_result.append(record)
- return a_result
- Result batch started from 248089, expected 4428
Add Comment
Please, Sign In to add comment