未验证 提交 3e99f5d4 编写于 作者: 葛亚芳 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-data-ability.md.

Signed-off-by: N葛亚芳 <geyafang@huawei.com>
上级 2ff2d207
...@@ -13,13 +13,10 @@ DataAbility 谓词用于构造关系型数据库的谓词,提供用于实现 ...@@ -13,13 +13,10 @@ DataAbility 谓词用于构造关系型数据库的谓词,提供用于实现
import dataAbility from '@ohos.data.dataAbility'; import dataAbility from '@ohos.data.dataAbility';
``` ```
## dataAbility.createRdbPredicates ## dataAbility.createRdbPredicates
createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates
从DataAbilityPredicates对象创建RdbPredicates对象。 从DataAbilityPredicates对象创建RdbPredicates对象。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -45,18 +42,14 @@ createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): ...@@ -45,18 +42,14 @@ createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates):
let predicates = dataAbility.createRdbPredicates("EMPLOYEE", dataAbilityPredicates) let predicates = dataAbility.createRdbPredicates("EMPLOYEE", dataAbilityPredicates)
``` ```
## DataAbilityPredicates ## DataAbilityPredicates
提供用于实现不同查询方法的谓词。 提供用于实现不同查询方法的谓词。
### equalTo ### equalTo
equalTo(field: string, value: ValueType): DataAbilityPredicates equalTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值等于指定值的字段。 配置谓词以匹配数据类型为ValueType且值等于指定值的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -80,13 +73,10 @@ equalTo(field: string, value: ValueType): DataAbilityPredicates ...@@ -80,13 +73,10 @@ equalTo(field: string, value: ValueType): DataAbilityPredicates
dataAbilityPredicates.equalTo("NAME", "lisi") dataAbilityPredicates.equalTo("NAME", "lisi")
``` ```
### notEqualTo ### notEqualTo
notEqualTo(field: string, value: ValueType): DataAbilityPredicates notEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值不等于指定值的字段。 配置谓词以匹配数据类型为ValueType且值不等于指定值的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -110,13 +100,10 @@ notEqualTo(field: string, value: ValueType): DataAbilityPredicates ...@@ -110,13 +100,10 @@ notEqualTo(field: string, value: ValueType): DataAbilityPredicates
dataAbilityPredicates.notEqualTo("NAME", "lisi") dataAbilityPredicates.notEqualTo("NAME", "lisi")
``` ```
### beginWrap ### beginWrap
beginWrap(): DataAbilityPredicates beginWrap(): DataAbilityPredicates
向谓词添加左括号。 向谓词添加左括号。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -138,13 +125,10 @@ beginWrap(): DataAbilityPredicates ...@@ -138,13 +125,10 @@ beginWrap(): DataAbilityPredicates
.endWrap() .endWrap()
``` ```
### endWrap ### endWrap
endWrap(): DataAbilityPredicates endWrap(): DataAbilityPredicates
向谓词添加右括号。 向谓词添加右括号。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -166,13 +150,10 @@ endWrap(): DataAbilityPredicates ...@@ -166,13 +150,10 @@ endWrap(): DataAbilityPredicates
.endWrap() .endWrap()
``` ```
### or ### or
or(): DataAbilityPredicates or(): DataAbilityPredicates
将或条件添加到谓词中。 将或条件添加到谓词中。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -191,13 +172,10 @@ or(): DataAbilityPredicates ...@@ -191,13 +172,10 @@ or(): DataAbilityPredicates
.equalTo("NAME", "Rose") .equalTo("NAME", "Rose")
``` ```
### and ### and
and(): DataAbilityPredicates and(): DataAbilityPredicates
将和条件添加到谓词中。 将和条件添加到谓词中。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -216,13 +194,10 @@ and(): DataAbilityPredicates ...@@ -216,13 +194,10 @@ and(): DataAbilityPredicates
.equalTo("SALARY", 200.5) .equalTo("SALARY", 200.5)
``` ```
### contains ### contains
contains(field: string, value: string): DataAbilityPredicates contains(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且value包含指定值的字段。 配置谓词以匹配数据类型为string且value包含指定值的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -246,13 +221,10 @@ contains(field: string, value: string): DataAbilityPredicates ...@@ -246,13 +221,10 @@ contains(field: string, value: string): DataAbilityPredicates
dataAbilityPredicates.contains("NAME", "os") dataAbilityPredicates.contains("NAME", "os")
``` ```
### beginsWith ### beginsWith
beginsWith(field: string, value: string): DataAbilityPredicates beginsWith(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值以指定字符串开头的字段。 配置谓词以匹配数据类型为string且值以指定字符串开头的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -276,13 +248,10 @@ beginsWith(field: string, value: string): DataAbilityPredicates ...@@ -276,13 +248,10 @@ beginsWith(field: string, value: string): DataAbilityPredicates
dataAbilityPredicates.beginsWith("NAME", "os") dataAbilityPredicates.beginsWith("NAME", "os")
``` ```
### endsWith ### endsWith
endsWith(field: string, value: string): DataAbilityPredicates endsWith(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值以指定字符串结尾的字段。 配置谓词以匹配数据类型为string且值以指定字符串结尾的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -306,13 +275,10 @@ endsWith(field: string, value: string): DataAbilityPredicates ...@@ -306,13 +275,10 @@ endsWith(field: string, value: string): DataAbilityPredicates
dataAbilityPredicates.endsWith("NAME", "se") dataAbilityPredicates.endsWith("NAME", "se")
``` ```
### isNull ### isNull
isNull(field: string): DataAbilityPredicates isNull(field: string): DataAbilityPredicates
配置谓词以匹配值为null的字段。 配置谓词以匹配值为null的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -335,13 +301,10 @@ isNull(field: string): DataAbilityPredicates ...@@ -335,13 +301,10 @@ isNull(field: string): DataAbilityPredicates
dataAbilityPredicates.isNull("NAME") dataAbilityPredicates.isNull("NAME")
``` ```
### isNotNull ### isNotNull
isNotNull(field: string): DataAbilityPredicates isNotNull(field: string): DataAbilityPredicates
配置谓词以匹配值不为null的指定字段。 配置谓词以匹配值不为null的指定字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -364,13 +327,10 @@ isNotNull(field: string): DataAbilityPredicates ...@@ -364,13 +327,10 @@ isNotNull(field: string): DataAbilityPredicates
dataAbilityPredicates.isNotNull("NAME") dataAbilityPredicates.isNotNull("NAME")
``` ```
### like ### like
like(field: string, value: string): DataAbilityPredicates like(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值类似于指定字符串的字段。 配置谓词以匹配数据类型为string且值类似于指定字符串的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -398,7 +358,6 @@ like(field: string, value: string): DataAbilityPredicates ...@@ -398,7 +358,6 @@ like(field: string, value: string): DataAbilityPredicates
glob(field: string, value: string): DataAbilityPredicates glob(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string的指定字段。 配置谓词以匹配数据类型为string的指定字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -426,7 +385,6 @@ glob(field: string, value: string): DataAbilityPredicates ...@@ -426,7 +385,6 @@ glob(field: string, value: string): DataAbilityPredicates
between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value在指定范围内的指定字段。 配置谓词以匹配数据类型为ValueType且value在指定范围内的指定字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -455,7 +413,6 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates ...@@ -455,7 +413,6 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value超出给定范围的指定字段。 配置谓词以匹配数据类型为ValueType且value超出给定范围的指定字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -484,7 +441,6 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate ...@@ -484,7 +441,6 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate
greaterThan(field: string, value: ValueType): DataAbilityPredicates greaterThan(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值大于指定值的字段。 配置谓词以匹配数据类型为ValueType且值大于指定值的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -512,7 +468,6 @@ greaterThan(field: string, value: ValueType): DataAbilityPredicates ...@@ -512,7 +468,6 @@ greaterThan(field: string, value: ValueType): DataAbilityPredicates
lessThan(field: string, value: ValueType): DataAbilityPredicates lessThan(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为valueType且value小于指定值的字段。 配置谓词以匹配数据类型为valueType且value小于指定值的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
...@@ -563,7 +518,6 @@ greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates ...@@ -563,7 +518,6 @@ greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
dataAbilityPredicates.greaterThanOrEqualTo("AGE", 18) dataAbilityPredicates.greaterThanOrEqualTo("AGE", 18)
``` ```
### lessThanOrEqualTo ### lessThanOrEqualTo
lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册