SparkDataItem
Represents an item from the database
getTTL
signature getTTL()
returns number
The TTL (in milliseconds since the Epoch time) for this item
getData
signature getData()
returns JSON
The JSON data of the item
delete
signature delete()
returns SparkDataResult
Deletes the item from the DB
getId
signature getId()
returns string
The ID of the item
persistor
signature persistor()
returns SparkDataItemPersistor
Gets a persistor object allowing you to control how the data is written to the database
setData
signature setData(JSON data)
returns SparkDataItem
The JSON data of the item
setTTL
signature setTTL(number ttl)
returns void
The TTL (in milliseconds since the Epoch time) for this item
getType
signature getType()
returns string
The type of the item
getValidationErrors
signature getValidationErrors()
returns string[]
Returns a set of paths that contain data that is invalid for storage
if set to false, the invalid items will be silently removed from the saved data