Property
public struct Property<E: EntityInspectable & __EntityRelatable, V: EntityPropertyTypeConvertible, R>
where E == E.EntityBindingType.EntityType
Metadata of object properties, used by the framework to determine how to store the values.
These are created by the code generator for you.
Usually, you only deal with this class when writing queries. The property names you use in your queries are actually instances of Property, and you can use operators and comparison methods like isLessThan() on them to express your queries. Below you see a list of methods that are available to you for property queries, apart from the operators described under Query Syntax.
-
Entity type that contains the property this object is describing.
Declaration
Swift
public typealias EntityType = E
-
Supported property value type this is describing.
Declaration
Swift
public typealias ValueType = V
-
If this is a ToOne property, this is the type it refers to. Otherwise Void.
Declaration
Swift
public typealias ReferencedType = R
-
Undocumented
Declaration
Swift
public init(propertyId: UInt32, isPrimaryKey: Bool = false)
-
Indicates if the property is the entity’s primary key.
Declaration
Swift
public var isPrimaryKey: Bool { get }
-
The internal ID of the property, in terms of the database schema.
Declaration
Swift
public var propertyId: UInt32 { get }
-
Undocumented
Declaration
Swift
public func isNil() -> PropertyQueryCondition<EntityType, ValueType>
-
Test whether a Int8 optional
Int8?
contains a value, notnil
, in a query on a property.Declaration
Swift
public func isNotNil() -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the == operator in query blocks.
Declaration
Swift
public func isEqual(to value: Id) -> PropertyQueryCondition<EntityType, Id>
-
Equivalent to the == operator in query blocks.
Declaration
Swift
public func isEqual(to value: Bool) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the != operator in query blocks.
Declaration
Swift
public func isNotEqual(to value: Bool) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the == operator in query blocks.
Declaration
Swift
public func isEqual(to value: Bool) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the != operator in query blocks.
Declaration
Swift
public func isNotEqual(to value: Bool) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the == operator in query blocks.
Declaration
Swift
public func isEqual(to value: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the != operator in query blocks.
Declaration
Swift
public func isNotEqual(to value: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the < operator in query blocks.
Declaration
Swift
public func isLessThan(_ value: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the > operator in query blocks.
Declaration
Swift
public func isGreaterThan(_ value: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
-
Matches all property values between
lowerBound
andupperBound
, including the bounds themselves. The order of the bounds does not matter.Declaration
Swift
public func isBetween(_ lowerBound: ValueType, and upperBound: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
Parameters
queryProperty
Entity property to compare values of.
lowerBound
Lower limiting value, inclusive.
upperBound
Upper limiting value, inclusive.
Return Value
QueryCondition
describing the property match condition. -
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ range: ClosedRange<ValueType>) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ range: Range<ValueType>) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ collection: [ValueType]) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∉ operator in query blocks.
Declaration
Swift
public func isNotIn(_ collection: [ValueType]) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the == operator in query blocks.
Declaration
Swift
public func isEqual(to other: ValueType, tolerance: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the < operator in query blocks.
Declaration
Swift
public func isLessThan(_ value: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the > operator in query blocks.
Declaration
Swift
public func isGreaterThan(_ value: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
-
Matches all property values between
lowerBound
andupperBound
, including the bounds themselves. The order of the bounds does not matter.Declaration
Swift
public func isBetween(_ lowerBound: ValueType, and upperBound: ValueType) -> PropertyQueryCondition<EntityType, ValueType>
Parameters
queryProperty
Entity property to compare values of.
lowerBound
Lower limiting value, inclusive.
upperBound
Upper limiting value, inclusive.
Return Value
QueryCondition
describing the property match condition.
-
Equivalent to the == operator in query blocks.
Declaration
Swift
public func isEqual(to string: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the != operator in query blocks.
Declaration
Swift
public func isNotEqual(to string: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the < operator in query blocks.
Declaration
Swift
public func isLessThan(_ string: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the > operator in query blocks.
Declaration
Swift
public func isGreaterThan(_ string: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ collection: [String], caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
Alternate name for startsWith(_,caseSensitive:).
Declaration
Swift
public func hasPrefix(_ prefix: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
In query blocks, use this to find prefix string matches of a property.
Declaration
Swift
public func startsWith(_ prefix: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
Alternate name for endsWith(_,caseSensitive:).
Declaration
Swift
public func hasSuffix(_ suffix: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
In query blocks, use this to find suffix string matches of a property.
Declaration
Swift
public func endsWith(_ suffix: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
In query blocks, use this to find substring matches of a property.
Declaration
Swift
public func contains(_ substring: String, caseSensitive: Bool = true) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the == operator in query blocks.
Declaration
Swift
public func isEqual(to data: Data) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the < operator in query blocks.
Declaration
Swift
public func isLessThan(_ data: Data) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the <= operator in query blocks.
Declaration
Swift
public func isLessThanEqual(_ data: Data) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the > operator in query blocks.
Declaration
Swift
public func isGreaterThan(_ data: Data) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the >= operator in query blocks.
Declaration
Swift
public func isGreaterThanEqual(_ data: Data) -> PropertyQueryCondition<EntityType, ValueType>
-
Undocumented
Declaration
Swift
public func isEqual(to date: Date) -> PropertyQueryCondition<EntityType, ValueType>
-
Undocumented
Declaration
Swift
public func isNotEqual(to date: Date) -> PropertyQueryCondition<EntityType, ValueType>
-
Matches all property values between
lowerBound
andupperBound
, including the bounds themselves. The order of the bounds does not matter.Declaration
Swift
public func isBetween(_ lowerBound: Date, and upperBound: Date) -> PropertyQueryCondition<EntityType, ValueType>
Parameters
lowerBound
Earliest date, inclusive.
upperBound
Latest date, inclusive.
Return Value
QueryCondition
describing the property match condition. -
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ range: Range<Date>) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ range: ClosedRange<Date>) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ collection: [Date]) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∉ operator in query blocks.
Declaration
Swift
public func isNotIn(_ collection: [Date]) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the < operator in query blocks.
Declaration
Swift
public func isBefore(_ other: Date) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the > operator in query blocks.
Declaration
Swift
public func isAfter(_ other: Date) -> PropertyQueryCondition<EntityType, ValueType>
-
Performs an approximate nearest neighbor (ANN) search to find objects near to the given
queryVector
.This requires the vector property to have an HNSW index.
The dimensions of the query vector should be at least the dimensions of this vector property.
Use
maxCount
to set the maximum number of objects to return by the ANN condition. Hint: it can also be used as the “ef” HNSW parameter to increase the search quality in combination with a query limit. For example, use maxResultCount of 100 with a query limit of 10 to have 10 results that are of potentially better quality than just passing in 10 for maxResultCount (quality/performance tradeoff).To change the given parameters after building the query, use
Query.setParameter(_:to:)
with either a[Float]
or[Int]
or their alias equivalent.Declaration
Swift
public func nearestNeighbors(queryVector: [Float], maxCount: Int) -> PropertyQueryCondition<EntityType, ValueType>
-
Undocumented
Declaration
Swift
public func isEqual(to date: Date) -> PropertyQueryCondition<EntityType, ValueType>
-
Undocumented
Declaration
Swift
public func isNotEqual(to date: Date) -> PropertyQueryCondition<EntityType, ValueType>
-
Matches all property values between
lowerBound
andupperBound
, including the bounds themselves. The order of the bounds does not matter.Declaration
Swift
public func isBetween(_ lowerBound: Date, and upperBound: Date) -> PropertyQueryCondition<EntityType, ValueType>
Parameters
lowerBound
Earliest date, inclusive.
upperBound
Latest date, inclusive.
Return Value
QueryCondition
describing the property match condition. -
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ range: Range<Date>) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ range: ClosedRange<Date>) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∈ operator in query blocks.
Declaration
Swift
public func isIn(_ collection: [Date]) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the ∉ operator in query blocks.
Declaration
Swift
public func isNotIn(_ collection: [Date]) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the < operator in query blocks.
Declaration
Swift
public func isBefore(_ other: Date) -> PropertyQueryCondition<EntityType, ValueType>
-
Equivalent to the > operator in query blocks.
Declaration
Swift
public func isAfter(_ other: Date) -> PropertyQueryCondition<EntityType, ValueType>