Skip to content

Data Object

Backendless database stores objects in data tables. A persisted object is stored in a language-independent format. Backendless supports persistence of arbitrary (typed or untyped) JavaScript objects. There are a few requirements imposed on the structure of the persisted objects:

  • Class must declare at least one property.
  • Backendless automatically assigns a unique ID to every persisted object. If the application needs to have access to the assigned ID, it can obtain it using a dynamically assigned property. Do NOT declare the objectId property - it will change the persistence behavior when objects are created in a remote data store:

    var objectId = persistedDataObject["objectId"];

  • In addition to objectId, Backendless maintains two additional properties for every persisted object - created and updated. The former contains the timestamp when the object was initially created in the Backendless data store. The latter is updated every time the object is updated. To get access to these values use the dynamically assigned properties:

    var createdTime = persistedDataObject["created"];
    var updatedTime = persistedDataObject["updated"];