[DATAMONGO-203] Add MongoOperations method that returns an Iterable<T> of converted domain objects as a result from a query Created: 19/Jul/11 Updated: 08/Jul/16 Resolved: 08/Jul/16
|Project:||Spring Data MongoDB|
|Component/s:||Mapping / Conversion|
|Affects Version/s:||1.0 M3|
|Reporter:||Mark Pollack||Assignee:||Mark Paluch|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
This will let one operate on the entities that were mapped from DBObject as they stream out of the DBCursor for processing a query result set.
|Comment by Nicolas Ivering [ 19/Apr/13 ]|
I'm interested in implementing this. I see a few possible approaches:
1. Add iterateXXX methods for each findXXX method. The iterateXXX methods would return an Iterator instead of a list. The iterator would load from DBCursor and deserialize object on every call to next(). Possibly you could instead return a class with implements both Iterator and Closeable, allowing the DBCursor to be closed.
What do you think?
|Comment by Walery Strauch [ 01/Apr/15 ]|
I believe this ticket is solved with this commit:
MongoOperation.stream(Query, Class<T>) does what is described in this issue.
|Comment by Mark Paluch [ 08/Jul/16 ]|
That's fixed with