Attribute
Attribute =
object
Defined in: src/types/attributes.ts:12
An entity attribute (key/value pair).
Arkiv supports both string and number values. Numeric values must be
integers — passing a non-integer number (e.g. 1.5) throws an
InvalidAttributeError at mutation time. To store a non-integer value:
- Scale it to an integer (e.g.
1.5->1500, dividing by the same factor on read) to keep numeric ordering and range queries working. - Or pass it as a string (e.g.
"1.5"), which sorts lexicographically and so does not support numeric comparisons.
Properties
Section titled “Properties”key:
string
Defined in: src/types/attributes.ts:13
value:
string|number
Defined in: src/types/attributes.ts:15
Attribute value. A number must be an integer (scale non-integers, e.g. 1.5 -> 1500, or use a string). Throws InvalidAttributeError otherwise.