MongoAggregateIterable
Processes the results of MongoDB aggregation operations.
all
all() : java.util.List<Values>
Description
Returns all documents from the aggregation result.
How To Use
const docs = collection.aggregate(...).all();
Return
( java.util.List )
The list of documents.
first
first() : Values
Description
Returns the first document from the aggregation result.
How To Use
const doc = collection.aggregate(...).first();
Return
( Values )
The first document or null if there are no results.
forEach
forEach(consumer: java.util.function.Consumer<Values>) : MongoAggregateIterable
Description
Performs an action for each document in the aggregation result.
How To Use
collection.aggregate(...).forEach((doc) => { /* process doc */ });
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| consumer | java.util.function.Consumer | The action to perform for each document. |
Return
This instance for chaining.
forEach(func: org.graalvm.polyglot.Value) : MongoAggregateIterable
Description
Executes a function for each document in the aggregation result.
How To Use
collection.aggregate(...).forEach((doc) => { /* process doc */ });
Attributes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| func | org.graalvm.polyglot.Value | The function to execute for each document. |
Return
This instance for chaining.