| NO_LEVEL | 0 | No security level is set for the KV store. |
| NO_LEVEL | 0 | No security level is set for the KV store.<br>**System capability**: SystemCapability.DistributedDataManager.KVStore.DistributedKVStore |
| S0 | 1 | The KV store security level is public.|
| S0 | 1 | The KV store security level is public.<br>**System capability**: SystemCapability.DistributedDataManager.KVStore.Core |
| S1 | 2 | The KV store security level is low. If data leakage occurs, minor impact will be caused on the database. For example, a KV store that contains system data such as wallpapers.|
| S1 | 2 | The KV store security level is low. If data leakage occurs, minor impact will be caused on the database. For example, a KV store that contains system data such as wallpapers.<br>**System capability**: SystemCapability.DistributedDataManager.KVStore.Core |
| S2 | 3 | The KV store security level is medium. If data leakage occurs, moderate impact will be caused on the database. For example, a KV store that contains information created by users or call records, such as audio or video clips.|
| S2 | 3 | The KV store security level is medium. If data leakage occurs, moderate impact will be caused on the database. For example, a KV store that contains information created by users or call records, such as audio or video clips.<br>**System capability**: SystemCapability.DistributedDataManager.KVStore.Core |
| S3 | 5 | The KV store security level is high. If data leakage occurs, major impact will be caused on the database. For example, a KV store that contains information such as user fitness, health, and location data.|
| S3 | 5 | The KV store security level is high. If data leakage occurs, major impact will be caused on the database. For example, a KV store that contains information such as user fitness, health, and location data.<br>**System capability**: SystemCapability.DistributedDataManager.KVStore.Core |
| S4 | 6 | The KV store security level is critical. If data leakage occurs, severe impact will be caused on the database. For example, a KV store that contains information such as authentication credentials and financial data.|
| S4 | 6 | The KV store security level is critical. If data leakage occurs, severe impact will be caused on the database. For example, a KV store that contains information such as authentication credentials and financial data.<br>**System capability**: SystemCapability.DistributedDataManager.KVStore.Core |
## Constants
## Constants
...
@@ -1025,7 +1008,7 @@ try {
...
@@ -1025,7 +1008,7 @@ try {
}).catch((err)=>{
}).catch((err)=>{
console.log('getResultSet failed: '+err);
console.log('getResultSet failed: '+err);
});
});
constmoved5=resultSet.move();
constmoved5=resultSet.move(1);
console.log("move succeed:"+moved5);
console.log("move succeed:"+moved5);
}catch(e){
}catch(e){
console.log("move failed: "+e);
console.log("move failed: "+e);
...
@@ -1065,7 +1048,7 @@ try {
...
@@ -1065,7 +1048,7 @@ try {
}).catch((err)=>{
}).catch((err)=>{
console.log('getResultSet failed: '+err);
console.log('getResultSet failed: '+err);
});
});
constmoved6=resultSet.moveToPosition();
constmoved6=resultSet.moveToPosition(1);
console.log("moveToPosition succeed: "+moved6);
console.log("moveToPosition succeed: "+moved6);
}catch(e){
}catch(e){
console.log("moveToPosition failed: "+e);
console.log("moveToPosition failed: "+e);
...
@@ -2156,7 +2139,7 @@ Adds a KV pair of the specified type to this KV store. This API uses an asynchro
...
@@ -2156,7 +2139,7 @@ Adds a KV pair of the specified type to this KV store. This API uses an asynchro
| key | string | Yes |Key of the KV pair to add. It cannot be empty, and the length cannot exceed [MAX_KEY_LENGTH](#constants). |
| key | string | Yes |Key of the KV pair to add. It cannot be empty, and the length cannot exceed [MAX_KEY_LENGTH](#constants). |
| value | Uint8Array \| string \| number \| boolean | Yes |Value of the KV pair to add. The value type can be Uint8Array, number, string, or boolean. A value of the Uint8Array or string type cannot exceed [MAX_VALUE_LENGTH](#constants). |
| value | Uint8Array \| string \| number \| boolean | Yes |Value of the KV pair to add. The value type can be Uint8Array, number, string, or boolean. A value of the Uint8Array or string type cannot exceed [MAX_VALUE_LENGTH](#constants). |
| callback | AsyncCallback<void> | Yes |Callback used to return the result. |
| callback | AsyncCallback<void> | Yes |Callback invoked to return the result. |
**Example**
**Example**
...
@@ -2229,7 +2212,7 @@ Deletes a KV pair from this KV store. This API uses an asynchronous callback to
...
@@ -2229,7 +2212,7 @@ Deletes a KV pair from this KV store. This API uses an asynchronous callback to
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | Yes |Conditions for deleting data. If this parameter is **null**, define the processing logic.|
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | Yes |Conditions for deleting data. If this parameter is **null**, define the processing logic.|
| callback | AsyncCallback<void> | Yes |Callback used to return the result. |
| callback | AsyncCallback<void> | Yes |Callback invoked to return the result. |
**Example**
**Example**
...
@@ -2395,8 +2378,8 @@ Backs up an RDB store. This API uses an asynchronous callback to return the resu
...
@@ -2395,8 +2378,8 @@ Backs up an RDB store. This API uses an asynchronous callback to return the resu
| file | string | Yes | Name of the database. The value cannot be empty or exceed [MAX_KEY_LENGTH](#constants).|
| file | string | Yes | Name of the RDB store. The value cannot be empty or exceed [MAX_KEY_LENGTH](#constants).|
| callback | AsyncCallback<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is the error object. |
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is the error object.|
**Example**
**Example**
...
@@ -2429,7 +2412,7 @@ Backs up an RDB store. This API uses a promise to return the result.
...
@@ -2429,7 +2412,7 @@ Backs up an RDB store. This API uses a promise to return the result.
| file | string | Yes | Name of the database file. The value cannot be empty or exceed [MAX_KEY_LENGTH](#constants).|
| file | string | Yes | Name of the database file. The value cannot be empty or exceed [MAX_KEY_LENGTH](#constants).|
| callback | AsyncCallback<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error object.|
| enabled |boolean | Yes |Whether to enable data synchronization. The value **true** means to enable data synchronization, and **false** means the opposite. |
| enabled |boolean | Yes |Whether to enable data synchronization. The value **true** means to enable data synchronization, and **false** means the opposite. |
| callback |AsyncCallback<void> | Yes |Callback used to return the result. |
| callback |AsyncCallback<void> | Yes |Callback invoked to return the result. |
**Example**
**Example**
...
@@ -3305,7 +3288,7 @@ Sets the data synchronization range. This API uses an asynchronous callback to r
...
@@ -3305,7 +3288,7 @@ Sets the data synchronization range. This API uses an asynchronous callback to r
Synchronizes the KV store manually. For details about the synchronization modes of the distributed data service, see [Distributed Data Service Overview](../../database/database-mdds-overview.md).
Synchronizes the KV store manually. For details about the synchronization modes of the distributed data service, see [Distributed Data Service Overview](../../database/database-mdds-overview.md).
Synchronizes the KV store manually. This API returns the result synchronously. For details about the synchronization modes of the distributed data service, see [Distributed Data Service Overview](../../database/database-mdds-overview.md).
Synchronizes the KV store manually. This API returns the result synchronously. For details about the synchronization modes of the distributed data service, see [Distributed Data Service Overview](../../database/database-mdds-overview.md).
Synchronizes the KV store manually. For details about the synchronization modes of the distributed data service, see [Distributed Data Service Overview](../../database/database-mdds-overview.md).
Synchronizes the KV store manually. For details about the synchronization modes of the distributed data service, see [Distributed Data Service Overview](../../database/database-mdds-overview.md).
Synchronizes the KV store manually. This API returns the result synchronously. For details about the synchronization modes of the distributed data service, see [Distributed Data Service Overview](../../database/database-mdds-overview.md).
Synchronizes the KV store manually. This API returns the result synchronously. For details about the synchronization modes of the distributed data service, see [Distributed Data Service Overview](../../database/database-mdds-overview.md).