Guest User

Untitled

a guest
May 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. a_result = []
  2. toSort = [('_id', 1)]
  3. number = 20000
  4. cursor = collectionObject.find(conditions,timeOut = False).sort(toSort).limit(number)
  5.  
  6. if cursor!= None and cursor.count() >0 and cursor.alive:
  7. for i in range(number):
  8. if cursor and cursor.alive:
  9. record = cursor.next(cursor,None)
  10. if record:
  11. a_result.append(record)
  12.  
  13. return a_result
  14.  
  15. Result batch started from 248089, expected 4428
Add Comment
Please, Sign In to add comment