Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
69ef007b
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
69ef007b
编写于
2月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1666 #I4TPHK已完成,请审核
Merge pull request !1666 from Annie_wang/PR1485
上级
11e57c9d
40b48754
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
56 addition
and
43 deletion
+56
-43
en/application-dev/reference/apis/js-apis-data-ability.md
en/application-dev/reference/apis/js-apis-data-ability.md
+1
-1
en/application-dev/reference/apis/js-apis-data-rdb.md
en/application-dev/reference/apis/js-apis-data-rdb.md
+1
-1
en/application-dev/reference/apis/js-apis-data-resultset.md
en/application-dev/reference/apis/js-apis-data-resultset.md
+36
-29
en/application-dev/reference/apis/js-apis-data-storage.md
en/application-dev/reference/apis/js-apis-data-storage.md
+18
-12
未找到文件。
en/application-dev/reference/apis/js-apis-data-ability.md
浏览文件 @
69ef007b
...
...
@@ -1338,7 +1338,7 @@ Sets the **DataAbilityPredicates** to filter out duplicate records.
```
let predicates = new dataAbility.DataAbilityPredicates("EMPLOYEE")
predicates.equalTo("NAME", "Rose").distinct("NAME")
let resultSet = await
rdbStore.query(predicates, ["NAME"])
rdbStore.query(predicates, ["NAME"])
```
...
...
en/application-dev/reference/apis/js-apis-data-rdb.md
浏览文件 @
69ef007b
...
...
@@ -750,7 +750,7 @@ Sets the **RdbPredicates** to filter out duplicate records.
```
let predicates = new data_rdb.RdbPredicates("EMPLOYEE")
predicates.equalTo("NAME", "Rose").distinct("NAME")
let resultSet = await
rdbStore.query(predicates, ["NAME"])
rdbStore.query(predicates, ["NAME"])
```
...
...
en/application-dev/reference/apis/js-apis-data-resultset.md
浏览文件 @
69ef007b
...
...
@@ -16,8 +16,8 @@ let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
predicates.equalTo("AGE", 18)
let promise = rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
promise.then((resultSet) => {
await console.log(TAG +
"resultSet columnNames:" + resultSet.columnNames);
await console.log(TAG + "resultSet columnCount:" + resultSet.columnCount);})
console.log(
"resultSet columnNames:" + resultSet.columnNames);
console.log("resultSet columnCount:" + resultSet.columnCount);
```
## Required Permissions<a name="section11257113618419"></a>
...
...
@@ -294,10 +294,11 @@ Moves the cursor to the row based on the specified offset.
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goTo(1)
resultSet.close()
resultSet = null
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goTo(1);
resultSet.close();
resultSet = null;
})
```
...
...
@@ -354,10 +355,11 @@ Moves the cursor to the specified row in the result set.
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToRow(1)
resultSet.close()
resultSet = null
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToRow(1);
resultSet.close();
resultSet = null
})
```
...
...
@@ -388,10 +390,11 @@ Moves the cursor to the first row of the result set.
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToFirstRow()
resultSet.close()
resultSet = null;
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToFirstRow();
resultSet.close();
resultSet = null;
})
```
...
...
@@ -422,10 +425,11 @@ Moves the cursor to the last row of the result set.
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToLastRow()
resultSet.close()
resultSet = null;
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToLastRow();
resultSet.close();
resultSet = null;
})
```
...
...
@@ -456,10 +460,11 @@ Moves the cursor to the next row in the result set.
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToNextRow()
resultSet.close()
resultSet = null;
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToNextRow()
resultSet.close()
resultSet = null;
})
```
...
...
@@ -490,10 +495,11 @@ Moves the cursor to the previous row in the result set.
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToPreviousRow()
resultSet.close()
resultSet = null
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToPreviousRow();
resultSet.close();
resultSet = null
})
```
...
...
@@ -783,9 +789,10 @@ Closes the result set.
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.close()
resultSet = null
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.close();
resultSet = null
})
```
en/application-dev/reference/apis/js-apis-data-storage.md
浏览文件 @
69ef007b
...
...
@@ -112,11 +112,13 @@ Reads a specified file and loads the data to the **Storage** instance for data
import dataStorage from '@ohos.data.storage'
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext()
var path = await context.getFilesDir()
let storage = dataStorage.getStorageSync(path + '/mystore')
storage.putSync('startup', 'auto')
storage.flushSync()
(async () => {
var context = featureAbility.getContext()
var path = await context.getFilesDir()
let storage = dataStorage.getStorageSync(path + '/mystore')
storage.putSync('startup', 'auto')
storage.flushSync()
})()
```
...
...
@@ -166,9 +168,10 @@ Reads a specified file and loads the data to the **Storage** instance for data
import dataStorage from '@ohos.data.storage'
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext()
var path = await context.getFilesDir()
dataStorage.getStorage(path + '/mystore', function (err, storage) {
(async () => {
var context = featureAbility.getContext()
var path = await context.getFilesDir()
dataStorage.getStorage(path + '/mystore', function (err, storage) {
if (err) {
console.info("Get the storage failed, path: " + path + '/mystore')
return;
...
...
@@ -176,6 +179,7 @@ Reads a specified file and loads the data to the **Storage** instance for data
storage.putSync('startup', 'auto')
storage.flushSync()
})
})()
```
...
...
@@ -233,15 +237,17 @@ Reads a specified file and loads the data to the **Storage** instance for data
import dataStorage from '@ohos.data.storage'
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext()
var path = await context.getFilesDir()
let promise = dataStorage.getStorage(path + '/mystore')
promise.then((storage) => {
(async () => {
var context = featureAbility.getContext()
var path = await context.getFilesDir()
let promise = dataStorage.getStorage(path + '/mystore')
promise.then((storage) => {
storage.putSync('startup', 'auto')
storage.flushSync()
}).catch((err) => {
console.info("Get the storage failed, path: " + path + '/mystore')
})
}()
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录