Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
c9568756
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看板
未验证
提交
c9568756
编写于
6月 08, 2022
作者:
葛
葛亚芳
提交者:
Gitee
6月 08, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
master:update zh-cn/application-dev/reference/apis/js-apis-data-ability.md:自动化测试问题修改,需同步翻译
Signed-off-by:
N
@ge-yafang
<
geyafang@huawei.com
>
上级
45b581e1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
56 deletion
+29
-56
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
+29
-56
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
浏览文件 @
c9568756
# DataAbility 谓词
> **说明:**
>
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...
...
@@ -69,8 +70,7 @@ equalTo(field: string, value: ValueType): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
equalTo
(
"
NAME
"
,
"
lisi
"
)
dataAbilityPredicates
.
equalTo
(
"
NAME
"
,
"
lisi
"
)
```
...
...
@@ -97,8 +97,7 @@ notEqualTo(field: string, value: ValueType): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
notEqualTo
(
"
NAME
"
,
"
lisi
"
)
dataAbilityPredicates
.
notEqualTo
(
"
NAME
"
,
"
lisi
"
)
```
...
...
@@ -119,8 +118,7 @@ beginWrap(): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbilitylity
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
equalTo
(
"
NAME
"
,
"
lisi
"
)
dataAbilityPredicates
.
equalTo
(
"
NAME
"
,
"
lisi
"
)
.
beginWrap
()
.
equalTo
(
"
AGE
"
,
18
)
.
or
()
...
...
@@ -146,8 +144,7 @@ endWrap(): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
equalTo
(
"
NAME
"
,
"
lisi
"
)
dataAbilityPredicates
.
equalTo
(
"
NAME
"
,
"
lisi
"
)
.
beginWrap
()
.
equalTo
(
"
AGE
"
,
18
)
.
or
()
...
...
@@ -173,8 +170,7 @@ or(): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
equalTo
(
"
NAME
"
,
"
Lisa
"
)
dataAbilityPredicates
.
equalTo
(
"
NAME
"
,
"
Lisa
"
)
.
or
()
.
equalTo
(
"
NAME
"
,
"
Rose
"
)
```
...
...
@@ -197,8 +193,7 @@ and(): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
equalTo
(
"
NAME
"
,
"
Lisa
"
)
dataAbilityPredicates
.
equalTo
(
"
NAME
"
,
"
Lisa
"
)
.
and
()
.
equalTo
(
"
SALARY
"
,
200.5
)
```
...
...
@@ -227,8 +222,7 @@ contains(field: string, value: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
contains
(
"
NAME
"
,
"
os
"
)
dataAbilityPredicates
.
contains
(
"
NAME
"
,
"
os
"
)
```
...
...
@@ -255,8 +249,7 @@ beginsWith(field: string, value: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
beginsWith
(
"
NAME
"
,
"
os
"
)
dataAbilityPredicates
.
beginsWith
(
"
NAME
"
,
"
os
"
)
```
...
...
@@ -283,8 +276,7 @@ endsWith(field: string, value: string): DataAbilityPredicates
**示例:**
```
let predicates = new dataAbility.DataAbilityPredicates("EMPLOYEE")
predicates.endsWith("NAME", "se")
dataAbilityPredicates.endsWith("NAME", "se")
```
...
...
@@ -310,8 +302,7 @@ isNull(field: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
isNull
(
"
NAME
"
)
dataAbilityPredicates
.
isNull
(
"
NAME
"
)
```
...
...
@@ -337,8 +328,7 @@ isNotNull(field: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
isNotNull
(
"
NAME
"
)
dataAbilityPredicates
.
isNotNull
(
"
NAME
"
)
```
...
...
@@ -365,8 +355,7 @@ like(field: string, value: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
like
(
"
NAME
"
,
"
%os%
"
)
dataAbilityPredicates
.
like
(
"
NAME
"
,
"
%os%
"
)
```
...
...
@@ -393,8 +382,7 @@ glob(field: string, value: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
glob
(
"
NAME
"
,
"
?h*g
"
)
dataAbilityPredicates
.
glob
(
"
NAME
"
,
"
?h*g
"
)
```
...
...
@@ -422,8 +410,7 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
between
(
"
AGE
"
,
10
,
50
)
dataAbilityPredicates
.
between
(
"
AGE
"
,
10
,
50
)
```
...
...
@@ -451,8 +438,7 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
notBetween
(
"
AGE
"
,
10
,
50
)
dataAbilityPredicates
.
notBetween
(
"
AGE
"
,
10
,
50
)
```
...
...
@@ -479,8 +465,7 @@ greaterThan(field: string, value: ValueType): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
greaterThan
(
"
AGE
"
,
18
)
dataAbilityPredicates
.
greaterThan
(
"
AGE
"
,
18
)
```
...
...
@@ -507,8 +492,7 @@ lessThan(field: string, value: ValueType): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
lessThan
(
"
AGE
"
,
20
)
dataAbilityPredicates
.
lessThan
(
"
AGE
"
,
20
)
```
...
...
@@ -535,8 +519,7 @@ greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
greaterThanOrEqualTo
(
"
AGE
"
,
18
)
dataAbilityPredicates
.
greaterThanOrEqualTo
(
"
AGE
"
,
18
)
```
...
...
@@ -563,8 +546,7 @@ lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
lessThanOrEqualTo
(
"
AGE
"
,
20
)
dataAbilityPredicates
.
lessThanOrEqualTo
(
"
AGE
"
,
20
)
```
...
...
@@ -590,8 +572,7 @@ orderByAsc(field: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
orderByAsc
(
"
NAME
"
)
dataAbilityPredicates
.
orderByAsc
(
"
NAME
"
)
```
...
...
@@ -617,8 +598,7 @@ orderByDesc(field: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
orderByDesc
(
"
AGE
"
)
dataAbilityPredicates
.
orderByDesc
(
"
AGE
"
)
```
...
...
@@ -639,8 +619,7 @@ distinct(): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
equalTo
(
"
NAME
"
,
"
Rose
"
).
distinct
(
"
NAME
"
)
dataAbilityPredicates
.
equalTo
(
"
NAME
"
,
"
Rose
"
).
distinct
(
"
NAME
"
)
let
promiseDistinct
=
rdbStore
.
query
(
predicates
,
[
"
NAME
"
])
promiseDistinct
.
then
((
resultSet
)
=>
{
console
.
log
(
"
distinct
"
)
...
...
@@ -672,8 +651,7 @@ limitAs(value: number): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
equalTo
(
"
NAME
"
,
"
Rose
"
).
limitAs
(
3
)
dataAbilityPredicates
.
equalTo
(
"
NAME
"
,
"
Rose
"
).
limitAs
(
3
)
```
...
...
@@ -699,8 +677,7 @@ offsetAs(rowOffset: number): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
equalTo
(
"
NAME
"
,
"
Rose
"
).
offsetAs
(
3
)
dataAbilityPredicates
.
equalTo
(
"
NAME
"
,
"
Rose
"
).
offsetAs
(
3
)
```
...
...
@@ -726,8 +703,7 @@ groupBy(fields: Array<string>): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
groupBy
([
"
AGE
"
,
"
NAME
"
])
dataAbilityPredicates
.
groupBy
([
"
AGE
"
,
"
NAME
"
])
```
### indexedBy
...
...
@@ -751,8 +727,7 @@ indexedBy(field: string): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
indexedBy
(
"
SALARY_INDEX
"
)
dataAbilityPredicates
.
indexedBy
(
"
SALARY_INDEX
"
)
```
...
...
@@ -780,8 +755,7 @@ in(field: string, value: Array<ValueType>): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
in
(
"
AGE
"
,
[
18
,
20
])
dataAbilityPredicates
.
in
(
"
AGE
"
,
[
18
,
20
])
```
...
...
@@ -809,8 +783,7 @@ notIn(field: string, value: Array<ValueType>): DataAbilityPredicates
**示例:**
```
js
let
predicates
=
new
dataAbility
.
DataAbilityPredicates
(
"
EMPLOYEE
"
)
predicates
.
notIn
(
"
NAME
"
,
[
"
Lisa
"
,
"
Rose
"
])
dataAbilityPredicates
.
notIn
(
"
NAME
"
,
[
"
Lisa
"
,
"
Rose
"
])
```
## ValueType
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录