Field Types - Node.js SDK
Realm supports the following field data types:
bool
maps to the JavaScript Boolean typeint
maps to the JavaScript Number type. Internally, Realm storesint
with 64 bits.float
maps to the JavaScript Number type. Internally, Realm storesfloat
with 32 bits.double
maps to the JavaScript Number type. Internally, Realm storesdouble
with 64 bits.string
maps to the JavaScript String type.decimal128
for high precision numbers.objectId
maps to BSON ObjectId type.data
maps to the JavaScript ArrayBuffer type.date
maps to the JavaScript Date type.list
maps to the JavaScript Array type. You can also specify that a field contains a list of primitive value types by appending[]
to the type name.linkingObjects
is a special type used to define an inverse relationship.dictionary
used to manage a collection of unique String keys paired with values. TheDictionary
data type is available in the realm-js@10.5.0 release.set
is based on the JavaScript Set type.Realm Set
is available in the realm-js@10.5.0 release.mixed
is a property type that can hold different data types. TheMixed
data type is available in the realm-js@10.5.0 release.uuid
is a universally unique identifier from Realm.BSON. TheUUID
data type is available in the realm-js@10.5.0 release.counter
functions as a logical counter when working with synchronized databases. Thecounter
data type and its associated class are available in the realm-js@12.10.0 release.
To learn how specific data types are mapped to BSON types in an App Services Schema, refer to Data Model Mapping in the Atlas App Services documentation.