未验证 提交 47b426ce 编写于 作者: O openharmony_ci 提交者: Gitee

!18491 [翻译完成】#I6Y3UN

Merge pull request !18491 from Annie_wang/cherry-pick-1684743745
......@@ -35,7 +35,6 @@ The following table lists the APIs used for KV data persistence. Most of the API
1. Create a **KvManager** instance to manage database objects.
Example:
Stage model:
......@@ -95,12 +94,11 @@ The following table lists the APIs used for KV data persistence. Most of the API
2. Create and obtain a KV store.
Example:
```js
try {
const options = {
createIfMissing: true, // Whether to create a KV store when the database file does not exist. By default, a KV store is created.
createIfMissing: true, // Whether to encrypt database files. By default, database files are not encrypted.
encrypt: false, // Whether to encrypt the KV store. By default, KV stores are not encrypted.
backup: false, // Whether to back up database files. By default, the database files are backed up.
autoSync: true, // Whether to automatically synchronize database files. The value **true** means to automatically synchronize database files; the value **false** (default) means the opposite.
kvStoreType: distributedKVStore.KVStoreType.SINGLE_VERSION, // Type of the KV store to create. By default, a device KV store is created.
......@@ -123,7 +121,6 @@ The following table lists the APIs used for KV data persistence. Most of the API
3. Use **put()** to add data to the KV store.
Example:
```js
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value_test_string';
......@@ -147,7 +144,6 @@ The following table lists the APIs used for KV data persistence. Most of the API
4. Use **get()** to obtain the value of a key.
Example:
```js
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value_test_string';
......@@ -174,7 +170,6 @@ The following table lists the APIs used for KV data persistence. Most of the API
5. Use **delete()** to delete the data of the specified key.
Example:
```js
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value_test_string';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册