INNER CODE UNIT · Swift
buildAggregate
orlandos-nl/MongoKitten · Sources/Meow/Aggregates.swift:49
public func buildAggregate<Result: Codable>(
@MeowUncheckedAggregateBuilder<M> build: () throws -> MeowAggregate<M, Result>
) rethrows -> MappedCursor<AggregateBuilderPipeline, Result> {
return try AggregateBuilderPipeline(
stages: build().stages,
collection: raw
).decode(Result.self)
}
}
public struct MeowAggregate<Model: ReadableModel, Result: Codable> {
var stages: [AggregateBuilderStage]
}
public protocol ModelProjection: KeyPathQueryableModel {
associatedtype Base: KeyPathQueryableModel
}