class AggregateIterableImpl<TDocument,TResult> extends MongoIterableImpl<TResult> implements AggregateIterable<TResult>
Modifier and Type | Field and Description |
---|---|
private java.lang.Boolean |
allowDiskUse |
private java.lang.Boolean |
bypassDocumentValidation |
private CodecRegistry |
codecRegistry |
private Collation |
collation |
private java.lang.String |
comment |
private java.lang.Class<TDocument> |
documentClass |
private Bson |
hint |
private long |
maxAwaitTimeMS |
private long |
maxTimeMS |
private MongoNamespace |
namespace |
private java.util.List<? extends Bson> |
pipeline |
private java.lang.Class<TResult> |
resultClass |
private java.lang.Boolean |
useCursor |
private WriteConcern |
writeConcern |
Constructor and Description |
---|
AggregateIterableImpl(ClientSession clientSession,
MongoNamespace namespace,
java.lang.Class<TDocument> documentClass,
java.lang.Class<TResult> resultClass,
CodecRegistry codecRegistry,
ReadPreference readPreference,
ReadConcern readConcern,
WriteConcern writeConcern,
OperationExecutor executor,
java.util.List<? extends Bson> pipeline) |
Modifier and Type | Method and Description |
---|---|
AggregateIterable<TResult> |
allowDiskUse(java.lang.Boolean allowDiskUse)
Enables writing to temporary files.
|
(package private) ReadOperation<BatchCursor<TResult>> |
asReadOperation() |
AggregateIterable<TResult> |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
AggregateIterable<TResult> |
bypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)
Sets the bypass document level validation flag.
|
AggregateIterable<TResult> |
collation(Collation collation)
Sets the collation options
|
AggregateIterable<TResult> |
comment(java.lang.String comment)
Sets the comment to the aggregation.
|
private AggregateToCollectionOperation |
createAggregateToCollectionOperation(java.util.List<BsonDocument> aggregateList) |
private java.util.List<BsonDocument> |
createBsonDocumentList(java.util.List<? extends Bson> pipeline) |
private BsonValue |
getOutCollection(java.util.List<BsonDocument> aggregateList) |
AggregateIterable<TResult> |
hint(Bson hint)
Sets the hint for which index to use.
|
AggregateIterable<TResult> |
maxAwaitTime(long maxAwaitTime,
java.util.concurrent.TimeUnit timeUnit)
The maximum amount of time for the server to wait on new documents to satisfy a
$changeStream aggregation. |
AggregateIterable<TResult> |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
void |
toCollection()
Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage.
|
AggregateIterable<TResult> |
useCursor(java.lang.Boolean useCursor)
Deprecated.
|
first, forEach, getBatchSize, getClientSession, getExecutor, getReadConcern, getReadPreference, into, iterator, map, toBsonDocumentOrNull, toBsonDocumentOrNull
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private final MongoNamespace namespace
private final java.lang.Class<TDocument> documentClass
private final java.lang.Class<TResult> resultClass
private final WriteConcern writeConcern
private final CodecRegistry codecRegistry
private final java.util.List<? extends Bson> pipeline
private java.lang.Boolean allowDiskUse
private long maxTimeMS
private long maxAwaitTimeMS
private java.lang.Boolean useCursor
private java.lang.Boolean bypassDocumentValidation
private Collation collation
private java.lang.String comment
private Bson hint
AggregateIterableImpl(ClientSession clientSession, MongoNamespace namespace, java.lang.Class<TDocument> documentClass, java.lang.Class<TResult> resultClass, CodecRegistry codecRegistry, ReadPreference readPreference, ReadConcern readConcern, WriteConcern writeConcern, OperationExecutor executor, java.util.List<? extends Bson> pipeline)
public void toCollection()
AggregateIterable
toCollection
in interface AggregateIterable<TResult>
public AggregateIterable<TResult> allowDiskUse(java.lang.Boolean allowDiskUse)
AggregateIterable
allowDiskUse
in interface AggregateIterable<TResult>
allowDiskUse
- true if writing to temporary files is enabledpublic AggregateIterable<TResult> batchSize(int batchSize)
MongoIterable
batchSize
in interface AggregateIterable<TResult>
batchSize
in interface MongoIterable<TResult>
batchSize
in class MongoIterableImpl<TResult>
batchSize
- the batch sizepublic AggregateIterable<TResult> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
AggregateIterable
maxTime
in interface AggregateIterable<TResult>
maxTime
- the max timetimeUnit
- the time unit, which may not be null@Deprecated public AggregateIterable<TResult> useCursor(java.lang.Boolean useCursor)
AggregateIterable
useCursor
in interface AggregateIterable<TResult>
useCursor
- whether the server should use a cursor to return resultspublic AggregateIterable<TResult> maxAwaitTime(long maxAwaitTime, java.util.concurrent.TimeUnit timeUnit)
AggregateIterable
$changeStream
aggregation.
A zero value will be ignored.maxAwaitTime
in interface AggregateIterable<TResult>
maxAwaitTime
- the max await timetimeUnit
- the time unit to return the result inpublic AggregateIterable<TResult> bypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)
AggregateIterable
Note: This only applies when an $out stage is specified
.bypassDocumentValidation
in interface AggregateIterable<TResult>
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.public AggregateIterable<TResult> collation(Collation collation)
AggregateIterable
A null value represents the server default.
collation
in interface AggregateIterable<TResult>
collation
- the collation options to usepublic AggregateIterable<TResult> comment(java.lang.String comment)
AggregateIterable
comment
in interface AggregateIterable<TResult>
comment
- the commentpublic AggregateIterable<TResult> hint(Bson hint)
AggregateIterable
hint
in interface AggregateIterable<TResult>
hint
- the hintReadOperation<BatchCursor<TResult>> asReadOperation()
asReadOperation
in class MongoIterableImpl<TResult>
private BsonValue getOutCollection(java.util.List<BsonDocument> aggregateList)
private AggregateToCollectionOperation createAggregateToCollectionOperation(java.util.List<BsonDocument> aggregateList)
private java.util.List<BsonDocument> createBsonDocumentList(java.util.List<? extends Bson> pipeline)