[JAVA-1253] AggregationOutput should not throw IllegalArgumentException on command failure Created: 21/May/14  Updated: 01/Apr/16  Resolved: 25/Jun/14

Status: Closed
Project: Java Driver
Component/s: Command Operations
Affects Version/s: 2.12.0
Fix Version/s: 2.12.3

Type: Bug Priority: Major - P3
Reporter: John Morales Assignee: Ross Lawley
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-1458 Aggregation problem with Enterprise v... Closed

 Description   

Currently the DBCollection.aggregate(final List<DBObject> pipeline) method which returns an AggregationOutput will throw an IllegalArgumentException to clients.

I would instead expect the command result to be checked with CommandResult.throwOnError() as is done for the other overloaded aggregate methods returning a DBCursor.



 Comments   
Comment by Githook User [ 01/Aug/14 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Ensure collection.aggregate throws on error

JAVA-1253
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/cdfafe5a45e839faea6c46406461640f15cf526c

Comment by Githook User [ 25/Jun/14 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Ensure collection.aggregate throws on error

JAVA-1253
Branch: 2.12.x
https://github.com/mongodb/mongo-java-driver/commit/cdfafe5a45e839faea6c46406461640f15cf526c

Comment by Martin Skøtt [ 26/May/14 ]

I have experienced the same issue with an aggregation which took a long time to run. Changing the code to use DBCollection.aggregate(final List<DBObject> pipeline, AggregationOptions options) instead fixed the problem for me.

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