Docs Menu
Docs Home
/ /
Atlas Device SDKs
/
/
/

Field Types - Node.js SDK

Realm supports the following field data types:

  • bool maps to the JavaScript Boolean type

  • int maps to the JavaScript Number type. Internally, Realm stores int with 64 bits.

  • float maps to the JavaScript Number type. Internally, Realm stores float with 32 bits.

  • double maps to the JavaScript Number type. Internally, Realm stores double 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. The Dictionary 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. The Mixed data type is available in the realm-js@10.5.0 release.

  • uuid is a universally unique identifier from Realm.BSON. The UUID data type is available in the realm-js@10.5.0 release.

  • counter functions as a logical counter when working with synchronized databases. The counter 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.

← 
 →