Aggregation
public struct Aggregation
Aggregation.
-
Field types to count.
See moreDeclaration
Swift
public enum FieldType: String
-
Functions used aggregation.
See moreDeclaration
Swift
public enum FunctionType: String
-
Name of a target field.
Declaration
Swift
public let field: String
-
Field type.
Declaration
Swift
public let fieldType: FieldType
-
Function type.
Declaration
Swift
public let function: FunctionType
-
Make aggregation.
Throws
‘ThingIFError.invalidArgument` if function and fieldType matches following cases:- Function type is
Aggregation.FunctionType.max
and field type not isAggregation.FieldType.integer
orAggregation.FieldType.decimal
- Function type is
Aggregation.FunctionType.min
and field type not isAggregation.FieldType.integer
orAggregation.FieldType.decimal
- Function type is
Aggregation.FunctionType.sum
and field type not isAggregation.FieldType.integer
orAggregation.FieldType.decimal
- Function type is
Aggregation.FunctionType.mean
and field type not isAggregation.FieldType.integer
orAggregation.FieldType.decimal
Declaration
Swift
public static func makeAggregation( _ function: FunctionType, field: String, fieldType: FieldType) throws -> Aggregation
Return Value
An instance of
Aggregation
. - Function type is
-
Make aggregation.
Declaration
Swift
public static func makeCountAggregation( _ field: String, fieldType: FieldType) -> Aggregation
Return Value
An instance of
Aggregation
for count function. -
Make mean aggregation.
Throws
‘ThingIFError.invalidArgument.If field type not is
Aggregation.FieldType.integeror
Aggregation.FieldType.decimal`Declaration
Swift
public static func makeMeanAggregation( _ field: String, fieldType: FieldType) throws -> Aggregation
Return Value
An instance of
Aggregation
for mean. -
Make max aggregation.
Throws
‘ThingIFError.invalidArgument.If field type not is
Aggregation.FieldType.integeror
Aggregation.FieldType.decimal`Declaration
Swift
public static func makeMaxAggregation( _ field: String, fieldType: FieldType) throws -> Aggregation
Return Value
An instance of
Aggregation
for max. -
Make min aggregation.
Throws
‘ThingIFError.invalidArgument.If field type not is
Aggregation.FieldType.integeror
Aggregation.FieldType.decimal`Declaration
Swift
public static func makeMinAggregation( _ field: String, fieldType: FieldType) throws -> Aggregation
Return Value
An instance of
Aggregation
for min. -
Make sum aggregation.
Throws
‘ThingIFError.invalidArgument.If field type not is
Aggregation.FieldType.integeror
Aggregation.FieldType.decimal`Declaration
Swift
public static func makeSumAggregation( _ field: String, fieldType: FieldType) throws -> Aggregation
Return Value
An instance of
Aggregation
for sum.