ParaDataStore

Description

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

Method

Method Name

Description

GetData

Gets data. If ParaDataInfo exists, this method also returns ParaDataInfo.

SetData

Sets data. You can also set associated metadata. This method returns the new value and associated metadata information.

IncrementData

Increments the value corresponding to a key and returns the new value.

UpdateData

Updates 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.

RemoveData

Deletes 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.

GetVersionData

Gets 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.

RemoveVersionData

Permanently 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.

ListVersionsData

Queries the version content of a specified key and returns the content in the order of version.

ListKeys

Pulls 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.

ListValues

Pulls 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.