# KeyPath

    extension KeyPath: AnyKeyPathStringConvertible, KeyPathStringConvertible where Root: NSManagedObject, Value: AllowedObjectiveCKeyPathValue

    extension KeyPath where Root: NSManagedObject, Value: AllowedObjectiveCToManyRelationshipKeyPathValue

    extension KeyPath where Root: CoreStoreObject, Value: ToManyRelationshipKeyPathStringConvertible

### AnyKeyPathStringConvertible

- `cs_keyPathString`

  #### Declaration

  Swift

      public var cs_keyPathString: String { get }

### KeyPathStringConvertible

- `ObjectType`

  #### Declaration

  Swift

      public typealias ObjectType = Root

- `DestinationValueType`

  #### Declaration

  Swift

      public typealias DestinationValueType = Value

### Available where `Root`: `NSManagedObject`, `Value`: `AllowedObjectiveCToManyRelationshipKeyPathValue`

- `count()`

  Creates a `Where.Expression` clause for COUNT

      let dogsWithPlaymates = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets).count() > 1))

  #### Declaration

  Swift

      public func count() -> Where<Root>.Expression<Where<Root>.CollectionTarget, Int>

### Available where `Root`: `CoreStoreObject`, `Value`: `ToManyRelationshipKeyPathStringConvertible`

- `count()`

  Creates a `Where.Expression` clause for COUNT

      let dogsWithPlaymates = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets).count() > 1))

  #### Declaration

  Swift

      public func count() -> Where<Root>.Expression<Where<Root>.CollectionTarget, Int>