@SuppressWarnings("deprecation") <TResult> AggregateOperation<TResult> aggregate(final List<? extends Bson> pipeline, final Class<TResult> resultClass, final long maxTimeMS, final long maxAwaitTimeMS, final Integer batchSize, final Collation collation, final Bson hint, final String comment, final Boolean allowDiskUse, final Boolean useCursor, final AggregationLevel aggregationLevel) { return new AggregateOperation<TResult>(namespace, toBsonDocumentList(pipeline), codecRegistry.get(resultClass), aggregationLevel) .maxTime(maxTimeMS, MILLISECONDS) .maxAwaitTime(maxAwaitTimeMS, MILLISECONDS) .allowDiskUse(allowDiskUse) .batchSize(batchSize) .useCursor(useCursor) .collation(collation) .hint(hint == null ? null : hint.toBsonDocument(documentClass, codecRegistry)) .comment(comment); }
.allowDiskUse(options.getAllowDiskUse()) .batchSize(options.getBatchSize()) .useCursor(options.getOutputMode() == com.mongodb.AggregationOptions.OutputMode.CURSOR) .collation(options.getCollation()); BatchCursor<DBObject> cursor = executor.execute(operation, readPreference, getReadConcern());
@SuppressWarnings("deprecation") <TResult> AggregateOperation<TResult> aggregate(final List<? extends Bson> pipeline, final Class<TResult> resultClass, final long maxTimeMS, final long maxAwaitTimeMS, final Integer batchSize, final Collation collation, final Bson hint, final String comment, final Boolean allowDiskUse, final Boolean useCursor, final AggregationLevel aggregationLevel) { return new AggregateOperation<TResult>(namespace, toBsonDocumentList(pipeline), codecRegistry.get(resultClass), aggregationLevel) .maxTime(maxTimeMS, MILLISECONDS) .maxAwaitTime(maxAwaitTimeMS, MILLISECONDS) .allowDiskUse(allowDiskUse) .batchSize(batchSize) .useCursor(useCursor) .collation(collation) .hint(hint == null ? null : hint.toBsonDocument(documentClass, codecRegistry)) .comment(comment); }
.allowDiskUse(options.getAllowDiskUse()) .batchSize(options.getBatchSize()) .useCursor(options.getOutputMode() == com.mongodb.AggregationOptions.OutputMode.CURSOR) .collation(options.getCollation()); BatchCursor<DBObject> cursor = executor.execute(operation, readPreference, getReadConcern());