AggregationPipeline
interface AggregationPipeline<Document : Any> : Pipeline<Document> , HasCount<Document> , HasLimit<Document> , HasMatch<Document> , HasProject<Document> , HasSample<Document> , HasSet<Document> , HasSkip<Document> , HasSort<Document> , HasUnionWith<Document> , HasUnionWithCompatibility<Document> , HasUnset<Document> (source)
An aggregation pipeline.
Aggregation pipelines read data from one or more collections and transform it in a manner of ways. Finally, the data can be sent to the server, or written to another collection.
Example
invoices.aggregate()
.match { Invoice::isDraft eq false }
.set {
Invoice::anomaly set (of(Invoice::modificationDate) lt of(Invoice::creationDate))
}
.sort { ascending(Invoice::creationDate) }
.toList()
Content copied to clipboard