# Functions Reference

# Functions

The following functions are available globally.

### KeyPath where Root: NSManagedObject, Value: QueryableAttributeType & Equatable

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))

  #### Declaration

  Swift

      public func == <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))

  #### Declaration

  Swift

      public func != <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains the value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))

  #### Declaration

  Swift

      public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, V>) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V == S.Element, S : Sequence

### KeyPath where Root: NSManagedObject, Value: Optional<QueryableAttributeType & Equatable>

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))

  #### Declaration

  Swift

      public func == <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))

  #### Declaration

  Swift

      public func != <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains the value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))

  #### Declaration

  Swift

      public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, Optional<V>>) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V == S.Element, S : Sequence

### KeyPath where Root: NSManagedObject, Value: QueryableAttributeType & Comparable

- `<(_:_:)`

  Creates a `Where` clause by comparing if a property is less than a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))

  #### Declaration

  Swift

      public func < <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable

- `>(_:_:)`

  Creates a `Where` clause by comparing if a property is greater than a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))

  #### Declaration

  Swift

      public func > <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable

- `<=(_:_:)`

  Creates a `Where` clause by comparing if a property is less than or equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))

  #### Declaration

  Swift

      public func <= <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable

- `>=(_:_:)`

  Creates a `Where` clause by comparing if a property is greater than or equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))

  #### Declaration

  Swift

      public func >= <O, V>(keyPath: KeyPath<O, V>, value: V) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable

### KeyPath where Root: NSManagedObject, Value: Optional<QueryableAttributeType & Comparable>

- `<(_:_:)`

  Creates a `Where` clause by comparing if a property is less than a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))

  #### Declaration

  Swift

      public func < <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable

- `>(_:_:)`

  Creates a `Where` clause by comparing if a property is greater than a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))

  #### Declaration

  Swift

      public func > <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable

- `<=(_:_:)`

  Creates a `Where` clause by comparing if a property is less than or equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))

  #### Declaration

  Swift

      public func <= <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable

- `>=(_:_:)`

  Creates a `Where` clause by comparing if a property is greater than or equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))

  #### Declaration

  Swift

      public func >= <O, V>(keyPath: KeyPath<O, Optional<V>>, value: V?) -> Where<O> where O : NSManagedObject, V : QueryableAttributeType, V : Comparable

### KeyPath where Root: NSManagedObject, Value: NSManagedObject

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))

  #### Declaration

  Swift

      public func == <O, D>(keyPath: KeyPath<O, D>, object: D) -> Where<O> where O : NSManagedObject, D : NSManagedObject

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))

  #### Declaration

  Swift

      public func != <O, D>(keyPath: KeyPath<O, D>, object: D) -> Where<O> where O : NSManagedObject, D : NSManagedObject

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains a value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))

  #### Declaration

  Swift

      public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, D>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, D == S.Element, S : Sequence

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))

  #### Declaration

  Swift

      public func == <O, D>(keyPath: KeyPath<O, D>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))

  #### Declaration

  Swift

      public func != <O, D>(keyPath: KeyPath<O, D>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains a value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))

  #### Declaration

  Swift

      public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, D>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, S : Sequence, S.Element == NSManagedObjectID

### KeyPath where Root: NSManagedObject, Value: Optional<NSManagedObject>

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))

  #### Declaration

  Swift

      public func == <O, D>(keyPath: KeyPath<O, Optional<D>>, object: D?) -> Where<O> where O : NSManagedObject, D : NSManagedObject

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))

  #### Declaration

  Swift

      public func != <O, D>(keyPath: KeyPath<O, Optional<D>>, object: D?) -> Where<O> where O : NSManagedObject, D : NSManagedObject

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains a value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))

  #### Declaration

  Swift

      public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, Optional<D>>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, D == S.Element, S : Sequence

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))

  #### Declaration

  Swift

      public func == <O, D>(keyPath: KeyPath<O, Optional<D>>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))

  #### Declaration

  Swift

      public func != <O, D>(keyPath: KeyPath<O, Optional<D>>, objectID: NSManagedObjectID) -> Where<O> where O : NSManagedObject, D : NSManagedObject

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains a value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))

  #### Declaration

  Swift

      public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, Optional<D>>) -> Where<O> where O : NSManagedObject, D : NSManagedObject, S : Sequence, S.Element == NSManagedObjectID

### KeyPath where Root: CoreStoreObject, Value: ValueContainer<Root>.Required<QueryableAttributeType & Equatable>

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))

  #### Declaration

  Swift

      public func == <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))

  #### Declaration

  Swift

      public func != <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains the value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))

  #### Declaration

  Swift

      public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, ValueContainer<O>.Required<V>>) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V == S.Element, S : Sequence

### KeyPath where Root: CoreStoreObject, Value: ValueContainer<Root>.Optional<QueryableAttributeType & Equatable>

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.nickname == "John"))

  #### Declaration

  Swift

      public func == <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.nickname != "John"))

  #### Declaration

  Swift

      public func != <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains the value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where(["Pluto", "Snoopy", "Scooby"] ~= \.nickname))

  #### Declaration

  Swift

      public func ~= <O, V, S>(sequence: S, keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V == S.Element, S : Sequence

### KeyPath where Root: CoreStoreObject, Value: ValueContainer<Root>.Required<QueryableAttributeType & Comparable>

- `<(_:_:)`

  Creates a `Where` clause by comparing if a property is less than a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))

  #### Declaration

  Swift

      public func < <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable

- `>(_:_:)`

  Creates a `Where` clause by comparing if a property is greater than a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))

  #### Declaration

  Swift

      public func > <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable

- `<=(_:_:)`

  Creates a `Where` clause by comparing if a property is less than or equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))

  #### Declaration

  Swift

      public func <= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable

- `>=(_:_:)`

  Creates a `Where` clause by comparing if a property is greater than or equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))

  #### Declaration

  Swift

      public func >= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, value: V) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType, V : Comparable

### KeyPath where Root: CoreStoreObject, Value: ValueContainer<Root>.Optional<QueryableAttributeType & Comparable>

- `<(_:_:)`

  Creates a `Where` clause by comparing if a property is less than a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age < 20))

  #### Declaration

  Swift

      public func < <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType

- `>(_:_:)`

  Creates a `Where` clause by comparing if a property is greater than a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age > 20))

  #### Declaration

  Swift

      public func > <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType

- `<=(_:_:)`

  Creates a `Where` clause by comparing if a property is less than or equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age <= 20))

  #### Declaration

  Swift

      public func <= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType

- `>=(_:_:)`

  Creates a `Where` clause by comparing if a property is greater than or equal to a value

      let person = CoreStore.fetchOne(From<Person>().where(\.age >= 20))

  #### Declaration

  Swift

      public func >= <O, V>(keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, value: V?) -> Where<O> where O : CoreStoreObject, V : ImportableAttributeType

### KeyPath where Root: CoreStoreObject, Value: RelationshipContainer<Root>.ToOne<CoreStoreObject>

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))

  #### Declaration

  Swift

      public func == <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject

- `==(_:_:)`

  Creates a `Where` clause by comparing if a property is equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master == john))

  #### Declaration

  Swift

      public func == <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D?) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))

  #### Declaration

  Swift

      public func != <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject

- `!=(_:_:)`

  Creates a `Where` clause by comparing if a property is not equal to a value

      let dog = CoreStore.fetchOne(From<Dog>().where(\.master != john))

  #### Declaration

  Swift

      public func != <O, D>(keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, object: D?) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject

- `~=(_:_:)`

  Creates a `Where` clause by checking if a sequence contains a value of a property

      let dog = CoreStore.fetchOne(From<Dog>().where([john, bob, joe] ~= \.master))

  #### Declaration

  Swift

      public func ~= <O, D, S>(sequence: S, keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>) -> Where<O> where O : CoreStoreObject, D : CoreStoreObject, D == S.Element, S : Sequence