HTML5 (Javascript) Client Reference
Class databaseobject
Language: Javascript (HTML5)
This class represents a database object in BigDB. It contains all the data of the database object, as well as a method for persisting any changes back to BigDB.
Properties | ||||
---|---|---|---|---|
|
||||
|
||||
|
||||
Methods | ||||
|
databaseobject.existsInDatabase
|
Returns true if this object has been persisted
databaseobject.key
|
The key of the database object
databaseobject.table
|
The table of the database object
databaseobject.save
|
Persist the object to the database, using optimistic locking and full overwrite if specified.
Arguments
useOptimisticLock:bool | |
If true, the save will only be completed if the database object has not changed in BigDB since this instance was loaded. | |
fullOverwrite:bool | |
Will completely overwrite the database object in BigDB with the properties in this instance, instead of just sending the changed properties to the server. | |
successCallback:function() | |
Callback function that will be called when the object have been successfully saved | |
errorCallback:function(PlayerIOError) | |
Callback function that will be called if an error occurs |