Optional
default?: unknownThe default value that the property will be set to when created.
Optional
indexed?: IndexedTypeThe type of index applied to the property.
Default value: false
if the property is not a primary key, otherwise true
.
Optional
mapThe name to be persisted in the Realm file if it differs from the already-defined JavaScript/TypeScript (JS/TS) property name. This is useful for allowing different naming conventions than what is persisted in the Realm file. Reading and writing properties must be done using the JS/TS name, but queries can use either the JS/TS name or the persisted name.
Optional
objectThe type of the elements in the collection if type
is a CollectionPropertyTypeName,
or the specific Realm object type if type
is a RelationshipPropertyTypeName.
Optional
optional?: booleanWhether to allow null
or undefined
to be assigned to the property; or in the
case of a collection, to be assigned to its elements. (Realm object types in lists
and sets cannot be optional.)
Default value: false
except in cases listed in the documentation for this type.
Optional
presentation?: PresentationPropertyTypeNameThe presentation type of the property.
Some types can be presented as a type different from the database type.
For instance, an integer that should behave like a logical counter is
presented as a "counter"
type.
// A counter
{
type: "int",
presentation: "counter",
}
Optional
property?: stringThe name of the property of the object specified in objectType
that creates this
link. (Can only be set for linking objects.)
The type of the property.
Generated using TypeDoc
The schema for specifying the type of a specific Realm object property.
Requirements:
"mixed"
types are always optional becausenull
is a valid value within"mixed"
itself. Therefore, they cannot be made non-optional.null
orundefined
. Whereas in in dictionaries, deleted values are set tonull
and cannot be made non-optional.