From 98d3056bf36996059fcda177bcd36d2a78793a1f Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Mon, 8 May 2023 17:14:14 +0800 Subject: [PATCH] update docs Signed-off-by: Annie_wang --- .../database/data-sync-of-kv-store.md | 2 +- .../apis/js-apis-distributedKVStore.md | 51 +++++++++---------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/en/application-dev/database/data-sync-of-kv-store.md b/en/application-dev/database/data-sync-of-kv-store.md index f6b2d2c55d..a32e605f9c 100644 --- a/en/application-dev/database/data-sync-of-kv-store.md +++ b/en/application-dev/database/data-sync-of-kv-store.md @@ -68,7 +68,7 @@ When data is added, deleted, or modified, a notification is sent to the subscrib - The KV stores do not support custom conflict resolution policies for applications. -- A maximum of 16 distributed KV stores can be opened simultaneously for an application. +- A maximum of 16 KV stores can be opened simultaneously for an application. - Each KV store supports a maximum of eight callbacks for subscription of data change notifications. diff --git a/en/application-dev/reference/apis/js-apis-distributedKVStore.md b/en/application-dev/reference/apis/js-apis-distributedKVStore.md index 2db407ff03..d1911570c6 100644 --- a/en/application-dev/reference/apis/js-apis-distributedKVStore.md +++ b/en/application-dev/reference/apis/js-apis-distributedKVStore.md @@ -23,7 +23,7 @@ import distributedKVStore from '@ohos.data.distributedKVStore'; ## KVManagerConfig -Defines the **KVManager** instance configuration, including the bundle name of the invoker and the application context. +Provides the **KVManager** instance configuration, including the bundle name of the invoker and the application context. **System capability**: SystemCapability.DistributedDataManager.KVStore.Core @@ -127,7 +127,7 @@ Enumerates the distributed KV store types. | Name | Description | | -------------------- | ------------------------------------------------------------ | -| DEVICE_COLLABORATION | Device KV store.
The device KV store manages data by device, which eliminates conflicts. Data can be queried by device.
**System capability**: SystemCapability.DistributedDataManager.KVStore.DistributedKVStore | +| DEVICE_COLLABORATION | Device KV store.
The device KV store manages data by device, which eliminates conflicts. Data can be queried by device.
**System capability**: SystemCapability.DistributedDataManager.KVStore.DistributedKVStore| | SINGLE_VERSION | Single KV store.
The single KV store does not differentiate data by device. If entries with the same key are modified on different devices, the value will be overwritten.
**System capability**: SystemCapability.DistributedDataManager.KVStore.Core | ## SecurityLevel @@ -136,7 +136,7 @@ Enumerates the KV store security levels. **System capability**: SystemCapability.DistributedDataManager.KVStore.Core -| Name | Description | +| Name | Description | | ---: | ------------------------------------------------------------ | | S1 | Low security level. Disclosure, tampering, corruption, or loss of the data may cause minor impact on an individual or group.
Examples: gender and nationality information, and user application records | | S2 | Medium security level. Disclosure, tampering, corruption, or loss of the data may cause major impact on an individual or group.
Examples: mailing addresses and nicknames of individuals | @@ -2028,7 +2028,7 @@ try { deviceId(deviceId:string):Query Creates a **Query** object with the device ID as the key prefix. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -2817,7 +2817,7 @@ try { removeDeviceData(deviceId: string, callback: AsyncCallback<void>): void Deletes data of a device. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -2869,7 +2869,7 @@ try { removeDeviceData(deviceId: string): Promise<void> Deletes data of a device. This API uses a promise to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -4548,7 +4548,7 @@ try { sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void Synchronizes the KV store manually. For details about the synchronization modes of KV stores, see [Cross-Device Synchronization of KV Stores](../../database/data-sync-of-kv-store.md). -> **NOTE**
+> **NOTE** > > The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. @@ -4617,7 +4617,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => { sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void Synchronizes the KV store manually. This API returns the result synchronously. For details about the synchronization modes of KV stores, see [Cross-Device Synchronization of KV Stores](../../database/data-sync-of-kv-store.md). -> **NOTE**
+> **NOTE** > > The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. @@ -4735,7 +4735,7 @@ Subscribes to synchronization complete events. | Name | Type | Mandatory| Description | | ------------ | --------------------------------------------- | ---- | ------------------------------------------------------ | | event | string | Yes | Event to subscribe to. The value is **syncComplete**, which indicates a synchronization complete event.| -| syncCallback | Callback<Array<[string, number]>> | Yes | Callback invoked to return the synchronization complete event. | +| syncCallback | Callback<Array<[string, number]>> | Yes | Callback invoked to return the synchronization complete event.| **Example** @@ -4769,7 +4769,7 @@ Unsubscribes from data changes. | Name | Type | Mandatory| Description | | -------- | --------------------------------------------------------- | ---- | -------------------------------------------------------- | | event | string | Yes | Event to unsubscribe from. The value is **dataChange**, which indicates a data change event.| -| listener | Callback<[ChangeNotification](#changenotification)> | No | Callback for data changes. | +| listener | Callback<[ChangeNotification](#changenotification)> | No | Callback for the data change event. | **Error codes** @@ -5044,7 +5044,7 @@ try { get(deviceId: string, key: string, callback: AsyncCallback<boolean | string | number | Uint8Array>): void Obtains a string value that matches the specified device ID and key. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -5099,7 +5099,7 @@ try { get(deviceId: string, key: string): Promise<boolean | string | number | Uint8Array> Obtains a string value that matches the specified device ID and key. This API uses a promise to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -5279,7 +5279,7 @@ try { getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback<Entry[]>): void Obtains all KV pairs that match the specified device ID and key prefix. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -5346,7 +5346,7 @@ try { getEntries(deviceId: string, keyPrefix: string): Promise<Entry[]> Obtains all KV pairs that match the specified device ID and key prefix. This API uses a promise to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -5542,7 +5542,7 @@ try { getEntries(deviceId: string, query: Query, callback: AsyncCallback<Entry[]>): void Obtains the KV pairs that match the specified device ID and **Query** object. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -5614,7 +5614,7 @@ try { getEntries(deviceId: string, query: Query): Promise<Entry[]> Obtains the KV pairs that match the specified device ID and **Query** object. This API uses a promise to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -5822,7 +5822,7 @@ try { getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback<KVStoreResultSet>): void Obtains a **KVStoreResultSet** object that matches the specified device ID and key prefix. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -5877,7 +5877,7 @@ try { getResultSet(deviceId: string, keyPrefix: string): Promise<KVStoreResultSet> Obtains a **KVStoreResultSet** object that matches the specified device ID and key prefix. This API uses a promise to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -5933,7 +5933,7 @@ try { getResultSet(deviceId: string, query: Query, callback: AsyncCallback<KVStoreResultSet>): void Obtains a **KVStoreResultSet** object that matches the specified device ID and **Query** object. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -6009,7 +6009,7 @@ try { getResultSet(deviceId: string, query: Query): Promise<KVStoreResultSet> Obtains a **KVStoreResultSet** object that matches the specified device ID and **Query** object. This API uses a promise to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -6152,7 +6152,7 @@ try { getResultSet(query: Query, callback:AsyncCallback<KVStoreResultSet>): void Obtains a **KVStoreResultSet** object that matches the specified **Query** object for this device. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -6341,7 +6341,7 @@ try { getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback<KVStoreResultSet>): void Obtains a **KVStoreResultSet** object that matches the specified predicate object and device ID. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -6402,7 +6402,7 @@ try { getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise<KVStoreResultSet> Obtains a **KVStoreResultSet** object that matches the specified predicate object and device ID. This API uses a promise to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -6583,7 +6583,7 @@ try { getResultSize(deviceId: string, query: Query, callback: AsyncCallback<number>): void; Obtains the number of results that matches the specified device ID and **Query** object. This API uses an asynchronous callback to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -6650,7 +6650,7 @@ try { getResultSize(deviceId: string, query: Query): Promise<number> Obtains the number of results that matches the specified device ID and **Query** object. This API uses a promise to return the result. -> **NOTE**
+> **NOTE** > > **deviceId** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications. > For details about how to obtain **deviceId**, see [sync()](#sync). @@ -6712,4 +6712,3 @@ try { console.error(`Failed to get resultSize.code is ${e.code},message is ${e.message}`); } ``` - \ No newline at end of file -- GitLab