# GroupBy

    public struct GroupBy<D> : GroupByClause, QueryClause, Hashable where D : DynamicObject

The `GroupBy` clause specifies that the result of a query be grouped accoording to the specified key path.

- `init()`

  Initializes a `GroupBy` clause with an empty list of key path strings

  #### Declaration

  Swift

      public init()

- `init(_:_:)`

  Initializes a `GroupBy` clause with a list of key path strings

  #### Declaration

  Swift

      public init(_ keyPath: KeyPathString, _ keyPaths: KeyPathString...)

  #### Parameters

  `keyPath` | a key path string to group results with
  `keyPaths` | a series of key path strings to group results with

- `init(_:)`

  Initializes a `GroupBy` clause with a list of key path strings

  #### Declaration

  Swift

      public init(_ keyPaths: [KeyPathString])

  #### Parameters

  `keyPaths` | a list of key path strings to group results with

### GroupByClause

- `ObjectType`

  #### Declaration

  Swift

      public typealias ObjectType = D

- `keyPaths`

  #### Declaration

  Swift

      public let keyPaths: [KeyPathString]

### Equatable

- `==(_:_:)`

  #### Declaration

  Swift

      public static func == (lhs: GroupBy, rhs: GroupBy) -> Bool

### Hashable

- `hash(into:)`

  #### Declaration

  Swift

      public func hash(into hasher: inout Hasher)

### CustomDebugStringConvertible

- `debugDescription`

  #### Declaration

  Swift

      public var debugDescription: String { get }

### GroupBy

- `init(_:)`

  Initializes a `GroupBy` clause with a key path

  #### Declaration

  Swift

      public init<T>(_ keyPath: KeyPath<D, T>)

  #### Parameters

  `keyPath` | a key path to group results with

### GroupBy

- `init(_:)`

  Initializes a `GroupBy` clause with a key path

  #### Declaration

  Swift

      public init<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<T>>) where T : ImportableAttributeType

  #### Parameters

  `keyPath` | a key path to group results with

- `init(_:)`

  Initializes a `GroupBy` clause with a key path

  #### Declaration

  Swift

      public init<T>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<T>>) where T : ImportableAttributeType

  #### Parameters

  `keyPath` | a key path to group results with

- `init(_:)`

  Initializes a `GroupBy` clause with a key path

  #### Declaration

  Swift

      public init<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<T>>) where T : NSCoding, T : NSCopying

  #### Parameters

  `keyPath` | a key path to group results with

- `init(_:)`

  Initializes a `GroupBy` clause with a key path

  #### Declaration

  Swift

      public init<T>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>) where T : NSCoding, T : NSCopying

  #### Parameters

  `keyPath` | a key path to group results with