[JAVA-2254] Add `toCollection` to AggregateIterable and MapReduceIterable in the Sync driver Created: 20/Jul/16  Updated: 24/Jan/17  Resolved: 22/Sep/16

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 3.4.0

Type: New Feature Priority: Major - P3
Reporter: Ross Lawley Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

They are available in the async driver - so should be available in the synchronous driver.

The workaround is to call AggregateIterable.first(), which incurs the extra expense of querying the out collection after the aggregation executes, which is not always desirable.



 Comments   
Comment by Githook User [ 22/Sep/16 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-2254: Change toCollection methods to asynchronous AggregateIterable and MapReduceIterable interfaces to throw IllegalStateException instead of IllegalArgumentExce

Useful for clients who just want to write the results to a collection but do not need to iterate over them.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/e33ca0c3cac6c605ef7627135c621c53f1b11401

Generated at Thu Feb 08 08:56:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.