diff --git a/en/application-dev/database/database-mdds-guidelines.md b/en/application-dev/database/database-mdds-guidelines.md index d14a9dbc4d0668faacff6e10390210abdb01469f..f059479e9d4e8215c5ff56e90415c7397fe08d3c 100644 --- a/en/application-dev/database/database-mdds-guidelines.md +++ b/en/application-dev/database/database-mdds-guidelines.md @@ -93,7 +93,7 @@ The following uses a single KV store as an example to describe the development p > ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> For data synchronization between networked devices, you are advised to open the distributed KV store during application startup to obtain the database handle. With this database handle (**kvStore** in this example), you can perform operations, such as inserting data into the KV store, without creating the KV store repeatedly during the lifecycle of the handle. -4. Subscribe to changes in the distributed data. +4. Subscribe to changes in the distributed data.
The following is the sample code for subscribing to the data changes of a single KV store: ``` kvStore.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_ALL, function (data) { @@ -147,7 +147,7 @@ The following uses a single KV store as an example to describe the development p } ``` -7. Synchronize data to other devices. +7. Synchronize data to other devices.
Select the devices in the same network and the synchronization mode to synchronize data. The following is the sample code for data synchronization in a single KV store. **deviceIds** can be obtained by deviceManager by calling **getTrustedDeviceListSync()**, and **1000** indicates that the maximum delay time is 1000 ms.