未验证 提交 2ff2d207 编写于 作者: 葛亚芳 提交者: Gitee

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

Signed-off-by: N葛亚芳 <geyafang@huawei.com>
上级 1484dc2e
...@@ -32,11 +32,13 @@ createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): ...@@ -32,11 +32,13 @@ createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates):
| dataAbilityPredicates | [DataAbilityPredicates](#dataabilitypredicates) | 是 | DataAbility谓词。 | | dataAbilityPredicates | [DataAbilityPredicates](#dataabilitypredicates) | 是 | DataAbility谓词。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| rdb.[RdbPredicates](js-apis-data-rdb.md#rdbpredicates) | 返回RdbPredicates对象。 | | rdb.[RdbPredicates](js-apis-data-rdb.md#rdbpredicates) | 返回RdbPredicates对象。 |
**示例:** **示例:**
```js ```js
let dataAbilityPredicates = new dataAbility.DataAbilityPredicates() let dataAbilityPredicates = new dataAbility.DataAbilityPredicates()
dataAbilityPredicates.equalTo("NAME", "Rose") dataAbilityPredicates.equalTo("NAME", "Rose")
...@@ -60,17 +62,20 @@ equalTo(field: string, value: ValueType): DataAbilityPredicates ...@@ -60,17 +62,20 @@ equalTo(field: string, value: ValueType): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 | | value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.equalTo("NAME", "lisi") dataAbilityPredicates.equalTo("NAME", "lisi")
``` ```
...@@ -87,17 +92,20 @@ notEqualTo(field: string, value: ValueType): DataAbilityPredicates ...@@ -87,17 +92,20 @@ notEqualTo(field: string, value: ValueType): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 | | value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.notEqualTo("NAME", "lisi") dataAbilityPredicates.notEqualTo("NAME", "lisi")
``` ```
...@@ -114,11 +122,13 @@ beginWrap(): DataAbilityPredicates ...@@ -114,11 +122,13 @@ beginWrap(): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回带有左括号的DataAbility谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回带有左括号的DataAbility谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.equalTo("NAME", "lisi") dataAbilityPredicates.equalTo("NAME", "lisi")
.beginWrap() .beginWrap()
...@@ -140,11 +150,13 @@ endWrap(): DataAbilityPredicates ...@@ -140,11 +150,13 @@ endWrap(): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回带有右括号的DataAbility谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回带有右括号的DataAbility谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.equalTo("NAME", "lisi") dataAbilityPredicates.equalTo("NAME", "lisi")
.beginWrap() .beginWrap()
...@@ -166,11 +178,13 @@ or(): DataAbilityPredicates ...@@ -166,11 +178,13 @@ or(): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回带有或条件的DataAbility谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回带有或条件的DataAbility谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Lisa") dataAbilityPredicates.equalTo("NAME", "Lisa")
.or() .or()
...@@ -189,11 +203,13 @@ and(): DataAbilityPredicates ...@@ -189,11 +203,13 @@ and(): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回带有和条件的DataAbility谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回带有和条件的DataAbility谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Lisa") dataAbilityPredicates.equalTo("NAME", "Lisa")
.and() .and()
...@@ -212,17 +228,20 @@ contains(field: string, value: string): DataAbilityPredicates ...@@ -212,17 +228,20 @@ contains(field: string, value: string): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | string | 是 | 指示要与谓词匹配的值。 | | value | string | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.contains("NAME", "os") dataAbilityPredicates.contains("NAME", "os")
``` ```
...@@ -239,17 +258,20 @@ beginsWith(field: string, value: string): DataAbilityPredicates ...@@ -239,17 +258,20 @@ beginsWith(field: string, value: string): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | string | 是 | 指示要与谓词匹配的值。 | | value | string | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.beginsWith("NAME", "os") dataAbilityPredicates.beginsWith("NAME", "os")
``` ```
...@@ -266,17 +288,20 @@ endsWith(field: string, value: string): DataAbilityPredicates ...@@ -266,17 +288,20 @@ endsWith(field: string, value: string): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | string | 是 | 指示要与谓词匹配的值。 | | value | string | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
``` ```
dataAbilityPredicates.endsWith("NAME", "se") dataAbilityPredicates.endsWith("NAME", "se")
``` ```
...@@ -293,16 +318,19 @@ isNull(field: string): DataAbilityPredicates ...@@ -293,16 +318,19 @@ isNull(field: string): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.isNull("NAME") dataAbilityPredicates.isNull("NAME")
``` ```
...@@ -319,16 +347,19 @@ isNotNull(field: string): DataAbilityPredicates ...@@ -319,16 +347,19 @@ isNotNull(field: string): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.isNotNull("NAME") dataAbilityPredicates.isNotNull("NAME")
``` ```
...@@ -345,25 +376,26 @@ like(field: string, value: string): DataAbilityPredicates ...@@ -345,25 +376,26 @@ like(field: string, value: string): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | string | 是 | 指示要与谓词匹配的值。 | | value | string | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.like("NAME", "%os%") dataAbilityPredicates.like("NAME", "%os%")
``` ```
### glob ### glob
glob(field: string, value: string): DataAbilityPredicates glob(field: string, value: string): DataAbilityPredicates
...@@ -372,25 +404,26 @@ glob(field: string, value: string): DataAbilityPredicates ...@@ -372,25 +404,26 @@ glob(field: string, value: string): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | string | 是 | 指示要与谓词匹配的值。 | | value | string | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.glob("NAME", "?h*g") dataAbilityPredicates.glob("NAME", "?h*g")
``` ```
### between ### between
between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
...@@ -399,6 +432,7 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates ...@@ -399,6 +432,7 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
...@@ -406,19 +440,19 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates ...@@ -406,19 +440,19 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
| high | [ValueType](#valuetype) | 是 | 指示与谓词匹配的最大值。 | | high | [ValueType](#valuetype) | 是 | 指示与谓词匹配的最大值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.between("AGE", 10, 50) dataAbilityPredicates.between("AGE", 10, 50)
``` ```
### notBetween ### notBetween
notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
...@@ -427,6 +461,7 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate ...@@ -427,6 +461,7 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
...@@ -434,19 +469,19 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate ...@@ -434,19 +469,19 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate
| high | [ValueType](#valuetype) | 是 | 指示与谓词匹配的最大值。 | | high | [ValueType](#valuetype) | 是 | 指示与谓词匹配的最大值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.notBetween("AGE", 10, 50) dataAbilityPredicates.notBetween("AGE", 10, 50)
``` ```
### greaterThan ### greaterThan
greaterThan(field: string, value: ValueType): DataAbilityPredicates greaterThan(field: string, value: ValueType): DataAbilityPredicates
...@@ -455,25 +490,26 @@ greaterThan(field: string, value: ValueType): DataAbilityPredicates ...@@ -455,25 +490,26 @@ greaterThan(field: string, value: ValueType): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 | | value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.greaterThan("AGE", 18) dataAbilityPredicates.greaterThan("AGE", 18)
``` ```
### lessThan ### lessThan
lessThan(field: string, value: ValueType): DataAbilityPredicates lessThan(field: string, value: ValueType): DataAbilityPredicates
...@@ -482,44 +518,47 @@ lessThan(field: string, value: ValueType): DataAbilityPredicates ...@@ -482,44 +518,47 @@ lessThan(field: string, value: ValueType): DataAbilityPredicates
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 | | value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.lessThan("AGE", 20) dataAbilityPredicates.lessThan("AGE", 20)
``` ```
### greaterThanOrEqualTo ### greaterThanOrEqualTo
greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value大于或等于指定值的字段。 配置谓词以匹配数据类型为ValueType且value大于或等于指定值的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 | | value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.greaterThanOrEqualTo("AGE", 18) dataAbilityPredicates.greaterThanOrEqualTo("AGE", 18)
``` ```
...@@ -527,151 +566,151 @@ greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates ...@@ -527,151 +566,151 @@ greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
### lessThanOrEqualTo ### lessThanOrEqualTo
lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value小于或等于指定值的字段。 配置谓词以匹配数据类型为ValueType且value小于或等于指定值的字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 | | value | [ValueType](#valuetype) | 是 | 指示要与谓词匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.lessThanOrEqualTo("AGE", 20) dataAbilityPredicates.lessThanOrEqualTo("AGE", 20)
``` ```
### orderByAsc ### orderByAsc
orderByAsc(field: string): DataAbilityPredicates orderByAsc(field: string): DataAbilityPredicates
配置谓词以匹配其值按升序排序的列。 配置谓词以匹配其值按升序排序的列。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.orderByAsc("NAME") dataAbilityPredicates.orderByAsc("NAME")
``` ```
### orderByDesc ### orderByDesc
orderByDesc(field: string): DataAbilityPredicates orderByDesc(field: string): DataAbilityPredicates
配置谓词以匹配其值按降序排序的列。 配置谓词以匹配其值按降序排序的列。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.orderByDesc("AGE") dataAbilityPredicates.orderByDesc("AGE")
``` ```
### distinct ### distinct
distinct(): DataAbilityPredicates distinct(): DataAbilityPredicates
配置谓词以过滤重复记录并仅保留其中一个。 配置谓词以过滤重复记录并仅保留其中一个。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回可用于过滤重复记录的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回可用于过滤重复记录的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Rose").distinct() dataAbilityPredicates.equalTo("NAME", "Rose").distinct()
``` ```
### limitAs ### limitAs
limitAs(value: number): DataAbilityPredicates limitAs(value: number): DataAbilityPredicates
设置最大数据记录数的谓词。 设置最大数据记录数的谓词。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | number | 是 | 最大数据记录数。 | | value | number | 是 | 最大数据记录数。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回可用于设置最大数据记录数的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回可用于设置最大数据记录数的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Rose").limitAs(3) dataAbilityPredicates.equalTo("NAME", "Rose").limitAs(3)
``` ```
### offsetAs ### offsetAs
offsetAs(rowOffset: number): DataAbilityPredicates offsetAs(rowOffset: number): DataAbilityPredicates
配置谓词以指定返回结果的起始位置。 配置谓词以指定返回结果的起始位置。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| rowOffset | number | 是 | 返回结果的起始位置,取值为正整数。 | | rowOffset | number | 是 | 返回结果的起始位置,取值为正整数。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回具有指定返回结果起始位置的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回具有指定返回结果起始位置的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Rose").offsetAs(3) dataAbilityPredicates.equalTo("NAME", "Rose").offsetAs(3)
``` ```
...@@ -679,66 +718,66 @@ offsetAs(rowOffset: number): DataAbilityPredicates ...@@ -679,66 +718,66 @@ offsetAs(rowOffset: number): DataAbilityPredicates
### groupBy ### groupBy
groupBy(fields: Array&lt;string&gt;): DataAbilityPredicates groupBy(fields: Array&lt;string&gt;): DataAbilityPredicates
配置谓词按指定列分组查询结果。 配置谓词按指定列分组查询结果。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| fields | Array&lt;string&gt; | 是 | 指定分组依赖的列名。 | | fields | Array&lt;string&gt; | 是 | 指定分组依赖的列名。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回分组查询列的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回分组查询列的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.groupBy(["AGE", "NAME"]) dataAbilityPredicates.groupBy(["AGE", "NAME"])
``` ```
### indexedBy ### indexedBy
indexedBy(field: string): DataAbilityPredicates indexedBy(field: string): DataAbilityPredicates
配置谓词以指定索引列。 配置谓词以指定索引列。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| indexName | string | 是 | 索引列的名称。 | | indexName | string | 是 | 索引列的名称。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回具有指定索引列的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回具有指定索引列的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.indexedBy("SALARY_INDEX") dataAbilityPredicates.indexedBy("SALARY_INDEX")
``` ```
### in ### in
in(field: string, value: Array&lt;ValueType&gt;): DataAbilityPredicates in(field: string, value: Array&lt;ValueType&gt;): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType数组且值在给定范围内的指定字段。 配置谓词以匹配数据类型为ValueType数组且值在给定范围内的指定字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
...@@ -746,39 +785,40 @@ in(field: string, value: Array&lt;ValueType&gt;): DataAbilityPredicates ...@@ -746,39 +785,40 @@ in(field: string, value: Array&lt;ValueType&gt;): DataAbilityPredicates
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.in("AGE", [18, 20]) dataAbilityPredicates.in("AGE", [18, 20])
``` ```
### notIn ### notIn
notIn(field: string, value: Array&lt;ValueType&gt;): DataAbilityPredicates notIn(field: string, value: Array&lt;ValueType&gt;): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType数组且值不在给定范围内的指定字段。 配置谓词以匹配数据类型为ValueType数组且值不在给定范围内的指定字段。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | 是 | 数据库表中的列名。 | | field | string | 是 | 数据库表中的列名。 |
| value | Array&lt;[ValueType](#valuetype)&gt; | 是 | 以ValueType类型数组形式指定的要匹配的值。 | | value | Array&lt;[ValueType](#valuetype)&gt; | 是 | 以ValueType类型数组形式指定的要匹配的值。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 | | [DataAbilityPredicates](#dataabilitypredicates) | 返回与指定字段匹配的谓词。 |
**示例:** **示例:**
```js ```js
dataAbilityPredicates.notIn("NAME", ["Lisa", "Rose"]) dataAbilityPredicates.notIn("NAME", ["Lisa", "Rose"])
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册