ParaDataStore

Description

This type of objects provides unified APIs for accessing persistent data.

Method

Method NameDescription
GetDataGets data. If ParaDataInfo exists, this method also returns ParaDataInfo.
SetDataSets data. You can also set associated metadata. This method returns the new value and associated metadata information.
IncrementDataIncrements the value corresponding to a key and returns the new value.
UpdateDataUpdates the data corresponding to a key through a callback function. The callback function gets the current value and returns the new value based on the defined logic. The callback function cannot be paused once executed.
RemoveDataDeletes the data corresponding to a key. This method does not actually delete the data due to version management. Instead, it creates a "gravestone" version and returns the original data.
GetVersionDataGets the data of a specified version. If ParaDataInfo exists, this method also returns ParaDataInfo.
If the data of the specified version does not exist, this method returns nil.
The version can be obtained through ListVersionData() or SetData.
RemoveVersionDataPermanently deletes the version of a specified key. The data cannot be restored once deleted.
If ParaDataStore is obtained using allScopes = true, the key must be in the format of "scope:key". Otherwise, the key does not need to be in that format. This applies to other APIs as well.
ListVersionsDataQueries the version content of a specified key and returns the content in the order of version.
ListKeysPulls the key list according to the prefix and returns the ParaDataPages page object, through which data can be incrementally pulled by page. If the ParaDataPages.GetCurrentPage() API is called, it returns the key list of string type.
ListValuesPulls the value list according to the prefix and returns the ParaDataPages page object, through which data can be incrementally pulled by page. If the ParaDataPages.GetCurrentPage() API is called, it returns the value list of ParaDataInfo type.