ParaDataService.GetDataStore

Declaration

ok, store = GetDataStore(string name, string scope = “global”, bool all_scope = false)

Parameters

Parameter NameDescription
nameName of a datastore, which is a unique identifier. Data in datastores with the same name is saved in the same data space.
scopeDomain name of a datastore, where data is stored independently by scope. If all_scope is set to false, all data keys in the datastore are prefixed with scope by default. Otherwise, you need to specify scope in data keys.
all_scopeSpecifies whether the obtained datastore can access all data in the domain across scopes. If the value is true, you need to specify scope in a data key, for example, use the scope:key format to access data.

Return Values

IndexTypeDescription
1intIf the value is 0, the operation is successful. The subsequent field is the obtained datastore.
2string or ParaDataStoreIf the operation is successful, the obtained ParaDataStore is returned. Otherwise, an error message is returned.

Description

Creates or gets a datastore object.

Data is stored in a key-value format, and the value can be any data type like number, string, boolean, or table. Besides, cross-scope search and prefix search are supported.