Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
3.6.3
-
None
-
None
Description
With the 3.6.3 Java driver running on Java 8u141, the AggregateIterableImpl returned from the DBCollection.aggregate(...) method throws a NoSuchMethodError when attempting to run the toCollection method. However, the AggregateIterable interface defines this method.
Compilation of the class is successful. The error appears to only be at runtime.
Reflection over the class shows the following methods are available:
- iterator
- iterator
- execute
- first
- forEach
- map
- createBsonDocumentList
- useCursor
- into
- bypassDocumentValidation
- maxTime
- batchSize
- batchSize
- allowDiskUse
Example to reproduce:
AggregateIterable<Document> pipeline = collection.aggregate(stages);
|
pipeline.toCollection();
|
The actual error is:
java.lang.NoSuchMethodError: com.mongodb.client.AggregateIterable.toCollection()V
|