title: Iterate over large collection in MongoDB via spring-data
body: <p>Friends!</p>
  
  <p>I am using MongoDB in java project via spring-data. I use Repository interfaces to access data in collections. For some processing I need to iterate over all elements of collection. I can use fetchAll method of repository, but it always return ArrayList.</p>
  
  <p>However, it is supposed that one of collections would be large - up to 1 million records several kilobytes each at least. I suppose I should not use fetchAll in such cases, but I could not find neither convenient methods returning some iterator (which may allow collection to be fetched partially), nor convenient methods with callbacks.</p>
  
  <p>I've seen only support for retrieving such collections in pages. I wonder whether it is the only way for working with such collections?</p>