diff --git a/Sources/KeyPath+Querying.swift b/Sources/KeyPath+Querying.swift index 9893789..25b549c 100644 --- a/Sources/KeyPath+Querying.swift +++ b/Sources/KeyPath+Querying.swift @@ -325,6 +325,11 @@ public func == (_ keyPath: KeyPath.ToOne>, return Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: object) } +public func == (_ keyPath: KeyPath.ToOne>, _ null: Void?) -> Where { + + return Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: nil) +} + public func != (_ keyPath: KeyPath.ToOne>, _ object: D) -> Where { return !Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: object) @@ -335,6 +340,11 @@ public func != (_ keyPath: KeyPath.ToOne>, return !Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: object) } +public func != (_ keyPath: KeyPath.ToOne>, _ null: Void?) -> Where { + + return !Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: nil) +} + public func ~= (_ sequence: S, _ keyPath: KeyPath.ToOne>) -> Where where S.Iterator.Element == D { return Where(O.meta[keyPath: keyPath].keyPath, isMemberOf: sequence)