Details
-
Bug
-
Resolution: Done
-
Major - P3
-
3.0.4
-
None
-
Java 7
MongoDB server version 3.0.x
Description
When executing an aggregate pipeline, the Java driver gives me a NullPointerException without further explanation.
While debugging I found that it's happening while trying to unbox AggregateIterableImpl.batchSize of type java.lang.Integer to be written to field FindIterableImpl.findOptions.batchSize of type int.
When I specify a batchSize() at the Aggregate other than null, e.g. explicitly setting it to "0" (the documented default value), everything is fine.
So, instead of just using
List<Document> result = collection.aggregate(pipeline).into(new LinkedList<Document>);
|
List<Document> result = collection.aggregate(pipeline).batchSize(0).into(new LinkedList<Document>);
|
I think it would help to change the type of the batchSize attribute of AggregateIterableImpl from java.lang.Integer to int, but I cannot tell whether it has any side-effects...