/** * Construct a new instance. * * @param namespace the database and collection namespace for the operation. * @param pipeline the aggregation pipeline. * @param decoder the decoder for the result documents. * @param aggregationLevel the aggregation level * @since 3.10 */ public AggregateOperation(final MongoNamespace namespace, final List<BsonDocument> pipeline, final Decoder<T> decoder, final AggregationLevel aggregationLevel) { this.wrapped = new AggregateOperationImpl<T>(namespace, pipeline, decoder, aggregationLevel); }
/** * Enables writing to temporary files. A null value indicates that it's unspecified. * * @param allowDiskUse true if writing to temporary files is enabled * @return this * @mongodb.driver.manual reference/command/aggregate/ Aggregation * @mongodb.server.release 2.6 */ public AggregateOperation<T> allowDiskUse(final Boolean allowDiskUse) { wrapped.allowDiskUse(allowDiskUse); return this; }
/** * Sets the number of documents to return per batch. * * @param batchSize the batch size * @return this * @mongodb.driver.manual reference/method/cursor.batchSize/#cursor.batchSize Batch Size */ public ChangeStreamOperation<T> batchSize(final Integer batchSize) { wrapped.batchSize(batchSize); return this; }
AggregateOperationImpl(final MongoNamespace namespace, final List<BsonDocument> pipeline, final Decoder<T> decoder, final AggregationLevel aggregationLevel) { this(namespace, pipeline, decoder, defaultAggregateTarget(notNull("aggregationLevel", aggregationLevel), notNull("namespace", namespace).getCollectionName()), defaultPipelineCreator(pipeline)); }
@Override public BatchCursor<T> execute(final ReadBinding binding) { return wrapped.execute(binding); }
/** * Sets the collation options * * <p>A null value represents the server default.</p> * * @param collation the collation options to use * @return this * @mongodb.driver.manual reference/command/aggregate/ Aggregation */ public ChangeStreamOperation<T> collation(final Collation collation) { wrapped.collation(collation); return this; }
@Override public void executeAsync(final AsyncReadBinding binding, final SingleResultCallback<AsyncBatchCursor<T>> callback) { wrapped.executeAsync(binding, callback); }
/** * Whether writing to temporary files is enabled. A null value indicates that it's unspecified. * * @return true if writing to temporary files is enabled * @mongodb.driver.manual reference/command/aggregate/ Aggregation * @mongodb.server.release 2.6 */ public Boolean getAllowDiskUse() { return wrapped.getAllowDiskUse(); }
/** * Sets the comment to the aggregation. A null value means no comment is set. * * @param comment the comment * @return this * @since 3.6 * @mongodb.server.release 3.6 */ public AggregateOperation<T> comment(final String comment) { wrapped.comment(comment); return this; }
AggregateOperationImpl(final MongoNamespace namespace, final List<BsonDocument> pipeline, final Decoder<T> decoder, final AggregationLevel aggregationLevel) { this(namespace, pipeline, decoder, defaultAggregateTarget(notNull("aggregationLevel", aggregationLevel), notNull("namespace", namespace).getCollectionName()), defaultPipelineCreator(pipeline)); }
@Override public BatchCursor<T> execute(final ReadBinding binding) { return new ChangeStreamBatchCursor<T>(ChangeStreamOperation.this, wrapped.execute(binding), binding); }
/** * Sets the collation options * * <p>A null value represents the server default.</p> * @param collation the collation options to use * @return this * @since 3.4 * @mongodb.driver.manual reference/command/aggregate/ Aggregation * @mongodb.server.release 3.4 */ public AggregateOperation<T> collation(final Collation collation) { wrapped.collation(collation); return this; }
@Override public void executeAsync(final AsyncReadBinding binding, final SingleResultCallback<AsyncBatchCursor<T>> callback) { wrapped.executeAsync(binding, new SingleResultCallback<AsyncBatchCursor<RawBsonDocument>>() { @Override public void onResult(final AsyncBatchCursor<RawBsonDocument> result, final Throwable t) { if (t != null) { callback.onResult(null, t); } else { callback.onResult(new AsyncChangeStreamBatchCursor<T>(ChangeStreamOperation.this, result, binding), null); } } }); }
/** * Whether writing to temporary files is enabled. A null value indicates that it's unspecified. * * @return true if writing to temporary files is enabled * @mongodb.driver.manual reference/command/aggregate/ Aggregation * @mongodb.server.release 2.6 */ public Boolean getAllowDiskUse() { return wrapped.getAllowDiskUse(); }
/** * Sets the comment to the aggregation. A null value means no comment is set. * * @param comment the comment * @return this * @since 3.6 * @mongodb.server.release 3.6 */ public AggregateOperation<T> comment(final String comment) { wrapped.comment(comment); return this; }
/** * Sets the number of documents to return per batch. * * @param batchSize the batch size * @return this * @mongodb.driver.manual reference/method/cursor.batchSize/#cursor.batchSize Batch Size */ public AggregateOperation<T> batchSize(final Integer batchSize) { wrapped.batchSize(batchSize); return this; }
/** * Construct a new instance. * * @param namespace the database and collection namespace for the operation. * @param fullDocument the fullDocument value * @param pipeline the aggregation pipeline. * @param decoder the decoder for the result documents. * @param changeStreamLevel the level at which the change stream is observing * * @since 3.8 */ public ChangeStreamOperation(final MongoNamespace namespace, final FullDocument fullDocument, final List<BsonDocument> pipeline, final Decoder<T> decoder, final ChangeStreamLevel changeStreamLevel) { this.wrapped = new AggregateOperationImpl<RawBsonDocument>(namespace, pipeline, RAW_BSON_DOCUMENT_CODEC, getAggregateTarget(), getPipelineCreator()); this.fullDocument = notNull("fullDocument", fullDocument); this.decoder = notNull("decoder", decoder); this.changeStreamLevel = notNull("changeStreamLevel", changeStreamLevel); }
@Override public BatchCursor<T> execute(final ReadBinding binding) { return wrapped.execute(binding); }
/** * Sets the collation options * * <p>A null value represents the server default.</p> * * @param collation the collation options to use * @return this * @mongodb.driver.manual reference/command/aggregate/ Aggregation */ public ChangeStreamOperation<T> collation(final Collation collation) { wrapped.collation(collation); return this; }
@Override public void executeAsync(final AsyncReadBinding binding, final SingleResultCallback<AsyncBatchCursor<T>> callback) { wrapped.executeAsync(binding, new SingleResultCallback<AsyncBatchCursor<RawBsonDocument>>() { @Override public void onResult(final AsyncBatchCursor<RawBsonDocument> result, final Throwable t) { if (t != null) { callback.onResult(null, t); } else { callback.onResult(new AsyncChangeStreamBatchCursor<T>(ChangeStreamOperation.this, result, binding), null); } } }); }