提交 30bd6062 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 350ebfae
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
The **DataShareResultSet** module provides APIs for accessing the result set obtained from the database. You can access the values in the specified rows or the value of the specified data type. The **DataShareResultSet** module provides APIs for accessing the result set obtained from the database. You can access the values in the specified rows or the value of the specified data type.
>**NOTE** > **NOTE**
> >
>The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
## Modules to Import ## Modules to Import
...@@ -44,7 +46,10 @@ dataShareHelper.query(uri, da, columns).then((data) => { ...@@ -44,7 +46,10 @@ dataShareHelper.query(uri, da, columns).then((data) => {
}); });
``` ```
## Attributes ## DataShareResultSet
Provides methods for accessing the result sets generated by querying the database.
### Attributes
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -55,7 +60,7 @@ dataShareHelper.query(uri, da, columns).then((data) => { ...@@ -55,7 +60,7 @@ dataShareHelper.query(uri, da, columns).then((data) => {
| rowCount | number | Yes | Number of rows in the result set. | | rowCount | number | Yes | Number of rows in the result set. |
| isClosed | boolean | Yes | Whether the result set is closed.| | isClosed | boolean | Yes | Whether the result set is closed.|
## goToFirstRow ### goToFirstRow
goToFirstRow(): boolean goToFirstRow(): boolean
...@@ -76,7 +81,7 @@ let isGoTOFirstRow = resultSet.goToFirstRow(); ...@@ -76,7 +81,7 @@ let isGoTOFirstRow = resultSet.goToFirstRow();
console.info('resultSet.goToFirstRow: ' + isGoTOFirstRow); console.info('resultSet.goToFirstRow: ' + isGoTOFirstRow);
``` ```
## goToLastRow ### goToLastRow
goToLastRow(): boolean goToLastRow(): boolean
...@@ -97,7 +102,7 @@ let isGoToLastRow = resultSet.goToLastRow(); ...@@ -97,7 +102,7 @@ let isGoToLastRow = resultSet.goToLastRow();
console.info('resultSet.goToLastRow: ' + isGoToLastRow); console.info('resultSet.goToLastRow: ' + isGoToLastRow);
``` ```
## goToNextRow ### goToNextRow
goToNextRow(): boolean goToNextRow(): boolean
...@@ -118,7 +123,7 @@ let isGoToNextRow = resultSet.goToNextRow(); ...@@ -118,7 +123,7 @@ let isGoToNextRow = resultSet.goToNextRow();
console.info('resultSet.goToNextRow: ' + isGoToNextRow); console.info('resultSet.goToNextRow: ' + isGoToNextRow);
``` ```
## goToPreviousRow ### goToPreviousRow
goToPreviousRow(): boolean goToPreviousRow(): boolean
...@@ -139,7 +144,7 @@ let isGoToPreviousRow = resultSet.goToPreviousRow(); ...@@ -139,7 +144,7 @@ let isGoToPreviousRow = resultSet.goToPreviousRow();
console.info('resultSet.goToPreviousRow: ' + isGoToPreviousRow); console.info('resultSet.goToPreviousRow: ' + isGoToPreviousRow);
``` ```
## goTo ### goTo
goTo(offset:number): boolean goTo(offset:number): boolean
...@@ -167,7 +172,7 @@ let isGoTo = resultSet.goTo(goToNum); ...@@ -167,7 +172,7 @@ let isGoTo = resultSet.goTo(goToNum);
console.info('resultSet.goTo: ' + isGoTo); console.info('resultSet.goTo: ' + isGoTo);
``` ```
## goToRow ### goToRow
goToRow(position: number): boolean goToRow(position: number): boolean
...@@ -195,7 +200,7 @@ let isGoToRow = resultSet.goToRow(goToRowNum); ...@@ -195,7 +200,7 @@ let isGoToRow = resultSet.goToRow(goToRowNum);
console.info('resultSet.goToRow: ' + isGoToRow); console.info('resultSet.goToRow: ' + isGoToRow);
``` ```
## getBlob ### getBlob
getBlob(columnIndex: number): Uint8Array getBlob(columnIndex: number): Uint8Array
...@@ -224,7 +229,7 @@ let getBlob = resultSet.getBlob(columnIndex); ...@@ -224,7 +229,7 @@ let getBlob = resultSet.getBlob(columnIndex);
console.info('resultSet.getBlob: ' + getBlob); console.info('resultSet.getBlob: ' + getBlob);
``` ```
## getString ### getString
getString(columnIndex: number): *string* getString(columnIndex: number): *string*
...@@ -253,7 +258,7 @@ let getString = resultSet.getString(columnIndex); ...@@ -253,7 +258,7 @@ let getString = resultSet.getString(columnIndex);
console.info('resultSet.getString: ' + getString); console.info('resultSet.getString: ' + getString);
``` ```
## getLong ### getLong
getLong(columnIndex: number): number getLong(columnIndex: number): number
...@@ -282,7 +287,7 @@ let getLong = resultSet.getLong(columnIndex); ...@@ -282,7 +287,7 @@ let getLong = resultSet.getLong(columnIndex);
console.info('resultSet.getLong: ' + getLong); console.info('resultSet.getLong: ' + getLong);
``` ```
## getDouble ### getDouble
getDouble(columnIndex: number): number getDouble(columnIndex: number): number
...@@ -311,7 +316,7 @@ let getDouble = resultSet.getDouble(columnIndex); ...@@ -311,7 +316,7 @@ let getDouble = resultSet.getDouble(columnIndex);
console.info('resultSet.getDouble: ' + getDouble); console.info('resultSet.getDouble: ' + getDouble);
``` ```
## close ### close
close(): void close(): void
...@@ -325,7 +330,7 @@ Closes this result set. ...@@ -325,7 +330,7 @@ Closes this result set.
resultSet.close(); resultSet.close();
``` ```
## getColumnIndex ### getColumnIndex
getColumnIndex(columnName: string): number getColumnIndex(columnName: string): number
...@@ -353,7 +358,7 @@ let getColumnIndex = resultSet.getColumnIndex(ColumnName) ...@@ -353,7 +358,7 @@ let getColumnIndex = resultSet.getColumnIndex(ColumnName)
console.info('resultSet.getColumnIndex: ' + getColumnIndex); console.info('resultSet.getColumnIndex: ' + getColumnIndex);
``` ```
## getColumnName ### getColumnName
getColumnName(columnIndex: number): *string* getColumnName(columnIndex: number): *string*
...@@ -381,7 +386,7 @@ let getColumnName = resultSet.getColumnName(columnIndex) ...@@ -381,7 +386,7 @@ let getColumnName = resultSet.getColumnName(columnIndex)
console.info('resultSet.getColumnName: ' + getColumnName); console.info('resultSet.getColumnName: ' + getColumnName);
``` ```
## getDataType ### getDataType
getDataType(columnIndex: number): DataType getDataType(columnIndex: number): DataType
......
# Data Share Predicates # Data Share Predicates
You can use **DataSharePredicates** to specify conditions for [updating](js-apis-data-dataShare.md#update), [deleting](js-apis-data-dataShare.md#delete), and [querying](js-apis-data-dataShare.md#query) data with **DataShare**. You can use **DataSharePredicates** to specify conditions for [updating](js-apis-data-dataShare.md#update), [deleting](js-apis-data-dataShare.md#delete), and [querying](js-apis-data-dataShare.md#query) data when **DataShare** is used to manage data.
>**NOTE** > **NOTE**
> >
>The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
## Modules to Import ## Modules to Import
...@@ -13,11 +15,14 @@ You can use **DataSharePredicates** to specify conditions for [updating](js-apis ...@@ -13,11 +15,14 @@ You can use **DataSharePredicates** to specify conditions for [updating](js-apis
import dataSharePredicates from '@ohos.data.dataSharePredicates'; import dataSharePredicates from '@ohos.data.dataSharePredicates';
``` ```
## equalTo ## DataSharePredicates
Provides methods for setting different **DataSharePredicates** objects.
### equalTo
equalTo(field: string, value: ValueType): DataSharePredicates equalTo(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **ValueType** and value equal to the specified value. Sets a **DataSharePredicates** object to match the data that is equal to the specified value.
Currently, only the relational database (RDB) and key-value database (KVDB, schema) support this **DataSharePredicates** object. Currently, only the relational database (RDB) and key-value database (KVDB, schema) support this **DataSharePredicates** object.
...@@ -34,7 +39,7 @@ Currently, only the relational database (RDB) and key-value database (KVDB, sche ...@@ -34,7 +39,7 @@ Currently, only the relational database (RDB) and key-value database (KVDB, sche
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -43,11 +48,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -43,11 +48,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose") predicates.equalTo("NAME", "Rose")
``` ```
## notEqualTo ### notEqualTo
notEqualTo(field: string, value: ValueType): DataSharePredicates notEqualTo(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **ValueType** and value not equal to the specified value. Sets a **DataSharePredicates** object to match the data that is not equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -64,7 +69,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -64,7 +69,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -73,11 +78,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -73,11 +78,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.notEqualTo("NAME", "Rose") predicates.notEqualTo("NAME", "Rose")
``` ```
## beginWrap ### beginWrap
beginWrap(): DataSharePredicates beginWrap(): DataSharePredicates
Adds a left parenthesis to this **DataSharePredicates**. Currently, only the RDB supports this **DataSharePredicates** object. Adds a left parenthesis to this **DataSharePredicates**.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -99,11 +106,13 @@ predicates.equalTo("NAME", "lisi") ...@@ -99,11 +106,13 @@ predicates.equalTo("NAME", "lisi")
.endWrap() .endWrap()
``` ```
## endWrap ### endWrap
endWrap(): DataSharePredicates endWrap(): DataSharePredicates
Adds a right parenthesis to this **DataSharePredicates** object. Currently, only the RDB supports this **DataSharePredicates** object. Adds a right parenthesis to this **DataSharePredicates** object.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -125,7 +134,7 @@ predicates.equalTo("NAME", "lisi") ...@@ -125,7 +134,7 @@ predicates.equalTo("NAME", "lisi")
.endWrap() .endWrap()
``` ```
## or ### or
or(): DataSharePredicates or(): DataSharePredicates
...@@ -150,7 +159,7 @@ predicates.equalTo("NAME", "lisi") ...@@ -150,7 +159,7 @@ predicates.equalTo("NAME", "lisi")
.equalTo("NAME", "Rose") .equalTo("NAME", "Rose")
``` ```
## and ### and
and(): DataSharePredicates and(): DataSharePredicates
...@@ -175,11 +184,13 @@ predicates.equalTo("NAME", "lisi") ...@@ -175,11 +184,13 @@ predicates.equalTo("NAME", "lisi")
.equalTo("SALARY", 200.5) .equalTo("SALARY", 200.5)
``` ```
## contains ### contains
contains(field: string, value: string): DataSharePredicates contains(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to match the string that contains the specified value. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to match the data that contains the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -188,13 +199,13 @@ Sets a **DataSharePredicates** object to match the string that contains the spec ...@@ -188,13 +199,13 @@ Sets a **DataSharePredicates** object to match the string that contains the spec
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------- | | ------ | ------ | ---- | -------------------- |
| field | string | Yes | Column name in the database table. | | field | string | Yes | Column name in the database table. |
| value | string | Yes | Value contained in the string.| | value | string | Yes | Value to match.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -203,11 +214,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -203,11 +214,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.contains("NAME", "os") predicates.contains("NAME", "os")
``` ```
## beginsWith ### beginsWith
beginsWith(field: string, value: string): DataSharePredicates beginsWith(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to match a string that starts with the specified value. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to match the data that begins with the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -216,13 +229,13 @@ Sets a **DataSharePredicates** object to match a string that starts with the spe ...@@ -216,13 +229,13 @@ Sets a **DataSharePredicates** object to match a string that starts with the spe
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------- | | ------ | ------ | ---- | ---------------------- |
| field | string | Yes | Column name in the database table. | | field | string | Yes | Column name in the database table. |
| value | string | Yes | Start value of the string.| | value | string | Yes | Start value to match.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -231,11 +244,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -231,11 +244,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.beginsWith("NAME", "os") predicates.beginsWith("NAME", "os")
``` ```
## endsWith ### endsWith
endsWith(field: string, value: string): DataSharePredicates endsWith(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to match a string that ends with the specified value. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to match the data that ends with the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -244,13 +259,13 @@ Sets a **DataSharePredicates** object to match a string that ends with the speci ...@@ -244,13 +259,13 @@ Sets a **DataSharePredicates** object to match a string that ends with the speci
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------- | | ------ | ------ | ---- | ---------------------- |
| field | string | Yes | Column name in the database table. | | field | string | Yes | Column name in the database table. |
| value | string | Yes | End value of the string.| | value | string | Yes | End value to match.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -259,11 +274,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -259,11 +274,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.endsWith("NAME", "os") predicates.endsWith("NAME", "os")
``` ```
## isNull ### isNull
isNull(field: string): DataSharePredicates isNull(field: string): DataSharePredicates
Sets a **DataSharePredicates** object to match the field whose value is null. Sets a **DataSharePredicates** object to match the data whose value is null.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -279,7 +294,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -279,7 +294,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -288,11 +303,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -288,11 +303,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.isNull("NAME") predicates.isNull("NAME")
``` ```
## isNotNull ### isNotNull
isNotNull(field: string): DataSharePredicates isNotNull(field: string): DataSharePredicates
Sets a **DataSharePredicates** object to match the field whose value is not null. Sets a **DataSharePredicates** object to match the data whose value is not null.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -308,7 +323,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -308,7 +323,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -317,11 +332,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -317,11 +332,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.isNotNull("NAME") predicates.isNotNull("NAME")
``` ```
## like ### like
like(field: string, value: string): DataSharePredicates like(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to match a string that is similar to the specified value. Sets a **DataSharePredicates** object to match the data that is similar to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -338,7 +353,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -338,7 +353,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -347,11 +362,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -347,11 +362,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.like("NAME", "%os%") predicates.like("NAME", "%os%")
``` ```
## unlike ### unlike
unlike(field: string, value: string): DataSharePredicates unlike(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to match a string that is not similar to the specified value. Sets a **DataSharePredicates** object to match the data that is not not similar to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -368,7 +383,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -368,7 +383,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -377,11 +392,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -377,11 +392,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.unlike("NAME", "%os%") predicates.unlike("NAME", "%os%")
``` ```
## glob ### glob
glob(field: string, value: string): DataSharePredicates glob(field: string, value: string): DataSharePredicates
Sets a **DataSharePredicates** object to match the specified string. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to match the specified string.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -396,7 +413,7 @@ Sets a **DataSharePredicates** object to match the specified string. Currently, ...@@ -396,7 +413,7 @@ Sets a **DataSharePredicates** object to match the specified string. Currently,
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified string.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -405,11 +422,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -405,11 +422,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.glob("NAME", "?h*g") predicates.glob("NAME", "?h*g")
``` ```
## between ### between
between(field: string, low: ValueType, high: ValueType): DataSharePredicates between(field: string, low: ValueType, high: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **ValueType** and value within the specified range. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to match the data that is within the specified range.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -425,7 +444,7 @@ Sets a **DataSharePredicates** object to match the field with data type **ValueT ...@@ -425,7 +444,7 @@ Sets a **DataSharePredicates** object to match the field with data type **ValueT
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -434,11 +453,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -434,11 +453,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.between("AGE", 10, 50) predicates.between("AGE", 10, 50)
``` ```
## notBetween ### notBetween
notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **ValueType** and value out of the specified range. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to match the data that is out of the specified range.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -454,7 +475,7 @@ Sets a **DataSharePredicates** object to match the field with data type **ValueT ...@@ -454,7 +475,7 @@ Sets a **DataSharePredicates** object to match the field with data type **ValueT
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -463,11 +484,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -463,11 +484,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.notBetween("AGE", 10, 50) predicates.notBetween("AGE", 10, 50)
``` ```
## greaterThan ### greaterThan
greaterThan(field: string, value: ValueType): DataSharePredicates greaterThan(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **ValueType** and value greater than the specified value. Sets a **DataSharePredicates** object to match the data that is greater than the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -484,7 +505,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -484,7 +505,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -493,11 +514,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -493,11 +514,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.greaterThan("AGE", 10) predicates.greaterThan("AGE", 10)
``` ```
## lessThan ### lessThan
lessThan(field: string, value: ValueType): DataSharePredicates lessThan(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **ValueType** and value less than the specified value. Sets a **DataSharePredicates** object to match the data that is less than the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -514,7 +535,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -514,7 +535,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -523,11 +544,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -523,11 +544,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.lessThan("AGE", 50) predicates.lessThan("AGE", 50)
``` ```
## greaterThanOrEqualTo ### greaterThanOrEqualTo
greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **ValueType** and value greater than or equal to the specified value. Sets a **DataSharePredicates** object to match the data that is greater than or equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -544,7 +565,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -544,7 +565,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -553,11 +574,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -553,11 +574,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.greaterThanOrEqualTo("AGE", 10) predicates.greaterThanOrEqualTo("AGE", 10)
``` ```
## lessThanOrEqualTo ### lessThanOrEqualTo
lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **ValueType** and value less than or equal to the specified value. Sets a **DataSharePredicates** object to match the data that is less than or equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -574,7 +595,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -574,7 +595,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -583,11 +604,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -583,11 +604,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.lessThanOrEqualTo("AGE", 50) predicates.lessThanOrEqualTo("AGE", 50)
``` ```
## orderByAsc ### orderByAsc
orderByAsc(field: string): DataSharePredicates orderByAsc(field: string): DataSharePredicates
Sets a **DataSharePredicates** object that sorts the values in a column in ascending order. Sets a **DataSharePredicates** object that sorts data in ascending order.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -603,7 +624,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -603,7 +624,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -612,11 +633,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -612,11 +633,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.orderByAsc("AGE") predicates.orderByAsc("AGE")
``` ```
## orderByDesc ### orderByDesc
orderByDesc(field: string): DataSharePredicates orderByDesc(field: string): DataSharePredicates
Sets a **DataSharePredicates** object that sorts the values in a column in descending order. Sets a **DataSharePredicates** object that sorts data in descending order.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -632,7 +653,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -632,7 +653,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -641,11 +662,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -641,11 +662,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.orderByDesc("AGE") predicates.orderByDesc("AGE")
``` ```
## distinct ### distinct
distinct(): DataSharePredicates distinct(): DataSharePredicates
Sets a **DataSharePredicates** object to filter out duplicate records. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to filter out duplicate data records.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -653,7 +676,7 @@ Sets a **DataSharePredicates** object to filter out duplicate records. Currently ...@@ -653,7 +676,7 @@ Sets a **DataSharePredicates** object to filter out duplicate records. Currently
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -662,7 +685,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -662,7 +685,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose").distinct() predicates.equalTo("NAME", "Rose").distinct()
``` ```
## limit ### limit
limit(total: number, offset: number): DataSharePredicates limit(total: number, offset: number): DataSharePredicates
...@@ -683,7 +706,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -683,7 +706,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -692,11 +715,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -692,11 +715,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose").limit(10, 3) predicates.equalTo("NAME", "Rose").limit(10, 3)
``` ```
## groupBy ### groupBy
groupBy(fields: Array&lt;string&gt;): DataSharePredicates groupBy(fields: Array&lt;string&gt;): DataSharePredicates
Sets a **DataSharePredicates** object to group the records according to the specified parameters. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object group the records according to the specified fields.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -704,13 +729,13 @@ Sets a **DataSharePredicates** object to group the records according to the spec ...@@ -704,13 +729,13 @@ Sets a **DataSharePredicates** object to group the records according to the spec
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------------- | ---- | -------------------- | | ------ | ------------- | ---- | -------------------- |
| fields | Array&lt;string&gt; | Yes | Names of the columns to group.| | fields | Array&lt;string&gt; | Yes | Names of the columns by which the records are grouped.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -719,11 +744,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -719,11 +744,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.groupBy(["AGE", "NAME"]) predicates.groupBy(["AGE", "NAME"])
``` ```
## indexedBy ### indexedBy
indexedBy(field: string): DataSharePredicates indexedBy(field: string): DataSharePredicates
Sets a **DataSharePredicates** object to specify the index column. Currently, only the RDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to list data by the specified index.
Currently, only the RDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -737,7 +764,7 @@ Sets a **DataSharePredicates** object to specify the index column. Currently, on ...@@ -737,7 +764,7 @@ Sets a **DataSharePredicates** object to specify the index column. Currently, on
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -746,11 +773,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -746,11 +773,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.indexedBy("SALARY_INDEX") predicates.indexedBy("SALARY_INDEX")
``` ```
## in ### in
in(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates in(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **Array<ValueType>** and value within the specified range. Sets a **DataSharePredicates** object to match the data that is within the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -761,13 +788,13 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -761,13 +788,13 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ---------------- | ---- | --------------------------------------- | | ------- | ---------------- | ---- | --------------------------------------- |
| field | string | Yes| Column name in the database table. | | field | string | Yes| Column name in the database table. |
| value | Array&lt;[ValueType](js-apis-data-ValuesBucket.md#valuetype)&gt; | Yes | Array of **ValueType**s to match.| | value | Array&lt;[ValueType](js-apis-data-ValuesBucket.md#valuetype)&gt; | Yes | Array of the values to match.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -776,11 +803,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -776,11 +803,11 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.in("AGE", [18, 20]) predicates.in("AGE", [18, 20])
``` ```
## notIn ### notIn
notIn(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates notIn(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates
Sets a **DataSharePredicates** object to match the field with data type **Array<ValueType>** and value out of the specified range. Sets a **DataSharePredicates** object to match the data that is not in the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object. Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
...@@ -791,13 +818,13 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -791,13 +818,13 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ---------------- | ---- | --------------------------------------- | | ------- | ---------------- | ---- | --------------------------------------- |
| field | string | Yes | Column name in the database table. | | field | string | Yes | Column name in the database table. |
| value | Array&lt;[ValueType](js-apis-data-ValuesBucket.md#valuetype)&gt; | Yes | Array of **ValueType**s to match.| | value | Array&lt;[ValueType](js-apis-data-ValuesBucket.md#valuetype)&gt; | Yes | Array of the values to match.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -806,11 +833,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -806,11 +833,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.notIn("NAME", ["Lisa", "Rose"]) predicates.notIn("NAME", ["Lisa", "Rose"])
``` ```
## prefixKey ### prefixKey
prefixKey(prefix: string): DataSharePredicates prefixKey(prefix: string): DataSharePredicates
Sets a **DataSharePredicates** object to match a field with the specified key prefix. Currently, only the KVDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to match the data with the specified key prefix.
Currently, only the KVDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -824,7 +853,7 @@ Sets a **DataSharePredicates** object to match a field with the specified key pr ...@@ -824,7 +853,7 @@ Sets a **DataSharePredicates** object to match a field with the specified key pr
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
...@@ -833,11 +862,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -833,11 +862,13 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.prefixKey("NAME") predicates.prefixKey("NAME")
``` ```
## inKeys ### inKeys
inKeys(keys: Array&lt;string&gt;): DataSharePredicates inKeys(keys: Array&lt;string&gt;): DataSharePredicates
Sets a **DataSharePredicates** object to match the fields whose keys are within the given range. Currently, only the KVDB supports this **DataSharePredicates** object. Sets a **DataSharePredicates** object to match the data whose keys are within the given range.
Currently, only the KVDB supports this **DataSharePredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -851,7 +882,7 @@ Sets a **DataSharePredicates** object to match the fields whose keys are within ...@@ -851,7 +882,7 @@ Sets a **DataSharePredicates** object to match the fields whose keys are within
| Type | Description | | Type | Description |
| ------------------------------------------- | -------------------------- | | ------------------------------------------- | -------------------------- |
| [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object that matches the specified field.| | [DataSharePredicates](#datasharepredicates) | **DataSharePredicates** object created.|
**Example** **Example**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册