Skip to content

Instance Method

aggregate(_:_:as:)

func aggregate<Field, Result>(_ method: DatabaseQuery.Aggregate.Method, _ field: KeyPath<Model, Field>, as type: Result.Type = Result.self) async throws -> Result where Field : QueryableProperty, Result : Decodable, Result : Encodable, Result : Sendable, Model.IDValue == Field.Model