提交 54bf9e3a 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 b482f8a1
...@@ -3,12 +3,19 @@ ...@@ -3,12 +3,19 @@
- Distributed Data Service - Distributed Data Service
- [Distributed Data Service Overview](database-mdds-overview.md) - [Distributed Data Service Overview](database-mdds-overview.md)
- [Distributed Data Service Development](database-mdds-guidelines.md) - [Distributed Data Service Development](database-mdds-guidelines.md)
- Relational Database - Relational Database
- [RDB Overview](database-relational-overview.md) - [RDB Overview](database-relational-overview.md)
- [RDB Development](database-relational-guidelines.md) - [RDB Development](database-relational-guidelines.md)
- Preferences - Preferences
- [Preferences Overview](database-preference-overview.md) - [Preferences Overview](database-preference-overview.md)
- [Preferences Development](database-preference-guidelines.md) - [Preferences Development](database-preference-guidelines.md)
- Distributed Data Object - Distributed Data Object
- [Distributed Data Object Overview](database-distributedobject-overview.md) - [Distributed Data Object Overview](database-distributedobject-overview.md)
- [Distributed Data Object Development](database-distributedobject-guidelines.md) - [Distributed Data Object Development](database-distributedobject-guidelines.md)
- Data Share
- [DataShare Overview](database-datashare-overview.md)
- [DataShare Development](database-datashare-guidelines.md)
# DataShare Development
The **DataShare** module allows an application to manage its own data and share data with other applications. Currently, data can be shared only between applications on the same device.
## Available APIs
**Table 1** APIs of the data provider
|API|Description|
|:------|:------|
|onCreate?(want: Want, callback: AsyncCallback&lt;void&gt;): void|Called to initialize service logic when the data provider application is created, for example, when a database is created.|
|insert?(uri: string, valueBucket: ValuesBucket, callback: AsyncCallback&lt;number&gt;): void|Inserts data into the database.|
|update?(uri: string, predicates: DataSharePredicates, valueBucket: ValuesBucket, callback: AsyncCallback&lt;number&gt;): void|Updates data in the database.|
|query?(uri: string, predicates: DataSharePredicates, columns: Array&lt;string&gt;, callback: AsyncCallback&lt;Object&gt;): void|Queries data from the database.|
|delete?(uri: string, predicates: DataSharePredicates, callback: AsyncCallback&lt;number&gt;): void|Deletes data from the database.|
For more details, see [DataShareExtensionAbility](../reference/apis/js-apis-application-DataShareExtensionAbility.md).
**Table 2** APIs of the data consumer
| API | Description |
| :----------------------------------------------------------- | :--------------------------------- |
| createDataShareHelper(context: Context, uri: string, callback: AsyncCallback&lt;DataShareHelper&gt;): void | Creates a **DataShareHelper** instance. |
| insert(uri: string, value: ValuesBucket, callback: AsyncCallback&lt;number&gt;): void | Inserts a single data record into the database. |
| update(uri: string, predicates: DataSharePredicates, value: ValuesBucket, callback: AsyncCallback&lt;number&gt;): void | Updates data in the database. |
| query(uri: string, predicates: DataSharePredicates, columns: Array&lt;string&gt;, callback: AsyncCallback&lt;DataShareResultSet&gt;): void | Queries data from the database. |
| delete(uri: string, predicates: DataSharePredicates, callback: AsyncCallback&lt;number&gt;): void | Deletes one or more data records from the database.|
For more details, see [DataShareHelper](../reference/apis/js-apis-data-dataShare.md).
## When to Use
There are two roles in **DataShare**.
- Data provider: adds, deletes, modifies, and queries data, opens files, and shares data.
- Data consumer: accesses the data provided by the provider using **DataShareHelper**.
Examples are given below.
### Data Provider Application Development (Only for System Applications)
1. Import the dependencies.
```ts
import Extension from '@ohos.application.DataShareExtensionAbility'
import rdb from '@ohos.data.rdb';
import fileIo from '@ohos.fileio'
import dataSharePredicates from '@ohos.data.dataSharePredicates'
```
2. Override **DataShareExtensionAbility** APIs based on actual requirements. For example, if the data provider provides only data query, override only the **query()** API.
3. Implement the data provider services. For example, implement data storage of the data provider by using a database, reading and writing files, or accessing the network.
```ts
let DB_NAME = "DB00.db";
let TBL_NAME = "TBL00";
let DDL_TBL_CREATE = "CREATE TABLE IF NOT EXISTS "
+ TBL_NAME
+ " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, isStudent BOOLEAN, Binary BINARY)";
let rdbStore;
let result;
export default class DataShareExtAbility extends Extension {
private rdbStore_;
// Override the onCreate() API.
onCreate(want, callback) {
result = this.context.cacheDir + '/datashare.txt'
// Create an RDB.
rdb.getRdbStore(this.context, {
name: DB_NAME
}, 1, function (err, data) {
rdbStore = data;
rdbStore.executeSql(DDL_TBL_CREATE, [], function (err) {
console.log('DataShareExtAbility onCreate, executeSql done err:' + JSON.stringify(err));
});
callback();
});
}
// Override the query() API.
query(uri, predicates, columns, callback) {
if (predicates == null || predicates == undefined) {
console.info('invalid predicates');
}
try {
rdbStore.query(TBL_NAME, predicates, columns, function (err, resultSet) {
if (resultSet != undefined) {
console.info('resultSet.rowCount: ' + resultSet.rowCount);
}
if (callback != undefined) {
callback(err, resultSet);
}
});
} catch (err) {
console.error('error' + err);
}
}
// Override other APIs as required.
// ...
};
```
4. Define **DataShareExtensionAbility** in **module.json5**.
| Field| Description |
| ------------ | ------------------------------------------------------------ |
| "name" | Ability name, corresponding to the **ExtensionAbility** class name derived from **Ability**. |
| "type" | Ability type. The value is **dataShare**, indicating the development is based on the **datashare** template.|
| "uri" | URI used for communication. It is the unique identifier for the data consumer to connect to the provider. |
| "visible" | Whether it is visible to other applications. Data sharing is allowed only when the value is **true**.|
**module.json5 example**
```json
"extensionAbilities": [
{
"srcEntrance": "./ets/DataShareExtAbility/DataShareExtAbility.ts",
"name": "DataShareExtAbility",
"icon": "$media:icon",
"description": "$string:description_datashareextability",
"type": "dataShare",
"uri": "datashare://com.samples.datasharetest.DataShare",
"visible": true
}
]
```
### Data Consumer Application Development
1. Import the dependencies.
```ts
import Ability from '@ohos.application.Ability'
import dataShare from '@ohos.data.dataShare'
import dataSharePredicates from '@ohos.data.dataSharePredicates'
```
2. Define the URI string for communicating with the data provider.
```ts
// Different from the URI defined in the module.json5 file, the URI passed in the parameter has an extra slash (/), because there is a DeviceID parameter between the second and the third slash (/).
let dseUri = ("datashare:///com.samples.datasharetest.DataShare");
```
2. Create a **DataShareHelper** instance.
```ts
let dsHelper;
let abilityContext;
export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
abilityContext = this.context;
dataShare.createDataShareHelper(abilityContext, dseUri, (err,data)=>{
dsHelper = data;
});
}
}
```
3. Use the APIs provided by **DataShareHelper** to access the services provided by the provider, for example, adding, deleting, modifying, and querying data.
```ts
// Construct a piece of data.
var valuesBucket = {"name": "ZhangSan", "age": 21, "isStudent": false, "Binary": new Uint8Array([1,2,3])};
var updateBucket = {"name": "LiSi", "age": 18, "isStudent": true, "Binary": new Uint8Array([1,2,3])};
let da = new dataSharePredicates.DataSharePredicates();
var valArray =new Array("*");
let people = new Array(
{"name": "LiSi", "age": 41, "Binary": ar},
{"name": "WangWu", "age": 21, "Binary": arr},
{"name": "ZhaoLiu", "age": 61, "Binary": arr});
// Insert a piece of data.
dsHelper.insert(dseUri, valuesBucket, (err,data) => {
console.log("dsHelper insert result: " + data);
});
// Delete data.
dsHelper.delete(dseUri, da, (err,data) => {
console.log("dsHelper delete result: " + data);
});
// Update data.
dsHelper.update(dseUri, da, updateBucket, (err,data) => {
console.log("dsHelper update result: " + data);
});
// Query data.
dsHelper.query(dseUri, da, valArray, (err,data) => {
console.log("dsHelper query result: " + data);
});
```
# DataShare Overview
## Introduction
The **DataShare** module allows an application to manage its own data and share data with other applications. Currently, data can be shared only between applications on the same device.
Data needs to be shared in a wealth of scenarios. For example, contacts, short message service (SMS), and media gallery always needs to be shared. However, certain data, such as accounts and passwords, cannot be shared. Some data, such as SMS messages, can be queried but not modified by other applications. **DataShare** provides a secure data sharing mechanism for applications in a variety of scenarios.
The data provider can directly use the **DataShare** framework to share data with other applications without complex encapsulation. The data consumer only needs to learn and use a set of interfaces because the data access mode does not vary with the data provisioning mode. This greatly reduces the learning time and development difficulty.
## Basic Concepts
Before you get started, familiarize yourself with the following concepts:
- Data provider
An application that provides data and implements related services. It is also called a producer or server.
- Data consumer
An application that accesses the data or services provided by a data provider. It is also called a client.
- Value bucket (**ValuesBucket**)
One or more data records stored in the form of key-value (KV) pairs. The keys are of the string type. The values can be of the number, string, Boolean, or Unit8Array type.
- Result set
A collection of query results. Flexible data access modes are provided for users to obtain data.
- Predicate
Conditions specified for updating, deleting, or querying data in the database.
## Working Principles
**Figure 1** DataShare mechanism
![](figures/en_DataShare.png)
- The **DataShareExtAbility** module, as the data provider, implements data sharing between applications.
- The **DataShareHelper** module, as the data consumer, provides interfaces for accessing data, including adding, deleting, modifying, and querying data.
- The data consumer communicates with the data provider using inter-process communication (IPC). The data provider can be implemented through a database or other data storage.
- The **ResultSet** module is implemented through shared memory. Shared memory stores the result sets, and interfaces are provided to traverse result sets.
## Constraints
- **DataShare** is subject to the limitations on the database used by the data provider. For example, the supported data models, length of the keys and values, and maximum number of databases that can be accessed at a time by each application vary with the database in use.
- The payloads of **ValuesBucket**, predicates, and result sets are restricted by IPC.
# 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.
## Modules to Import ## Modules to Import
...@@ -13,11 +13,14 @@ You can use **DataSharePredicates** to specify conditions for [updating](js-apis ...@@ -13,11 +13,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 +37,7 @@ Currently, only the relational database (RDB) and key-value database (KVDB, sche ...@@ -34,7 +37,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 +46,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -43,11 +46,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 +67,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -64,7 +67,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 +76,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -73,11 +76,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 +104,13 @@ predicates.equalTo("NAME", "lisi") ...@@ -99,11 +104,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 +132,7 @@ predicates.equalTo("NAME", "lisi") ...@@ -125,7 +132,7 @@ predicates.equalTo("NAME", "lisi")
.endWrap() .endWrap()
``` ```
## or ### or
or(): DataSharePredicates or(): DataSharePredicates
...@@ -150,7 +157,7 @@ predicates.equalTo("NAME", "lisi") ...@@ -150,7 +157,7 @@ predicates.equalTo("NAME", "lisi")
.equalTo("NAME", "Rose") .equalTo("NAME", "Rose")
``` ```
## and ### and
and(): DataSharePredicates and(): DataSharePredicates
...@@ -175,11 +182,13 @@ predicates.equalTo("NAME", "lisi") ...@@ -175,11 +182,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 +197,13 @@ Sets a **DataSharePredicates** object to match the string that contains the spec ...@@ -188,13 +197,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 +212,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -203,11 +212,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 +227,13 @@ Sets a **DataSharePredicates** object to match a string that starts with the spe ...@@ -216,13 +227,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 +242,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -231,11 +242,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 +257,13 @@ Sets a **DataSharePredicates** object to match a string that ends with the speci ...@@ -244,13 +257,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 +272,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -259,11 +272,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 +292,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -279,7 +292,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 +301,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -288,11 +301,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 +321,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -308,7 +321,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 +330,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -317,11 +330,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 +351,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -338,7 +351,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 +360,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -347,11 +360,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 +381,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -368,7 +381,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 +390,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -377,11 +390,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 +411,7 @@ Sets a **DataSharePredicates** object to match the specified string. Currently, ...@@ -396,7 +411,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 +420,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -405,11 +420,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 +442,7 @@ Sets a **DataSharePredicates** object to match the field with data type **ValueT ...@@ -425,7 +442,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 +451,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -434,11 +451,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 +473,7 @@ Sets a **DataSharePredicates** object to match the field with data type **ValueT ...@@ -454,7 +473,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 +482,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -463,11 +482,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 +503,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -484,7 +503,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 +512,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -493,11 +512,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 +533,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -514,7 +533,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 +542,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -523,11 +542,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 +563,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -544,7 +563,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 +572,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -553,11 +572,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 +593,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -574,7 +593,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 +602,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -583,11 +602,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 +622,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -603,7 +622,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 +631,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -612,11 +631,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 +651,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -632,7 +651,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 +660,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -641,11 +660,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 +674,7 @@ Sets a **DataSharePredicates** object to filter out duplicate records. Currently ...@@ -653,7 +674,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 +683,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -662,7 +683,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 +704,7 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -683,7 +704,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 +713,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -692,11 +713,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 +727,13 @@ Sets a **DataSharePredicates** object to group the records according to the spec ...@@ -704,13 +727,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 +742,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -719,11 +742,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 +762,7 @@ Sets a **DataSharePredicates** object to specify the index column. Currently, on ...@@ -737,7 +762,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 +771,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -746,11 +771,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 +786,13 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -761,13 +786,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 +801,11 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -776,11 +801,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 +816,13 @@ Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** o ...@@ -791,13 +816,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 +831,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -806,11 +831,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 +851,7 @@ Sets a **DataSharePredicates** object to match a field with the specified key pr ...@@ -824,7 +851,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 +860,13 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -833,11 +860,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 +880,7 @@ Sets a **DataSharePredicates** object to match the fields whose keys are within ...@@ -851,7 +880,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.
先完成此消息的编辑!
想要评论请 注册