diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-ability.md b/zh-cn/application-dev/reference/apis/js-apis-data-ability.md index 2d52224313736cca71317d2ab7da454fe83178ed..d05356f6b88de18d41f2794dbedeb6e2a3a45f2f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-data-ability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-data-ability.md @@ -640,7 +640,12 @@ distinct(): DataAbilityPredicates ``` let predicates = new dataAbility.DataAbilityPredicates("EMPLOYEE") predicates.equalTo("NAME", "Rose").distinct("NAME") - let resultSet = await rdbStore.query(predicates, ["NAME"]) + let promiseDistinct = rdbStore.query(predicates, ["NAME"]) + promiseDistinct.then((resultSet) => { + console.log("distinct") + }).catch((err) => { + expect(null).assertFail(); + }) ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md b/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md index 619f58102df945c8a71322245d9b2e5f2a6590e3..5ffd2caaedce397b1b45543341853d0635a95c5b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md +++ b/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md @@ -69,7 +69,7 @@ setSessionId(sessionId?: string): boolean - 参数: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | sessionId | string | 是 | 分布式对象在可信组网中的标识ID。 | + | sessionId | string | 否 | 分布式对象在可信组网中的标识ID。 | - 示例: ```js diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-rdb.md b/zh-cn/application-dev/reference/apis/js-apis-data-rdb.md index 885c53c4274375f641c8867158f9ff7d9a27c837..aa2ed82c6317cba173ee0cc2b40a090fe7ed869c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-data-rdb.md +++ b/zh-cn/application-dev/reference/apis/js-apis-data-rdb.md @@ -23,7 +23,7 @@ getRdbStore(context?: Context, config: StoreConfig, version: number, callback: A - 参数: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | context8+ | Context | 是 | 应用程序或功能的上下文 | + | context8+ | Context | 否 | 应用程序或功能的上下文 | | config | [StoreConfig](#storeconfig) | 是 | 与此RDB存储相关的数据库配置。 | | version | number | 是 | 数据库版本。 | | callback | AsyncCallback<[RdbStore](#rdbstore)> | 是 | 指定callback回调函数。返回一个RdbStore。 | @@ -53,7 +53,7 @@ getRdbStore(context?: Context, config: StoreConfig, version: number): Promise< - 参数: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | context8+ | Context | 是 | 应用程序或功能的上下文 | + | context8+ | Context | 否 | 应用程序或功能的上下文 | | config | [StoreConfig](#storeconfig) | 是 | 与此RDB存储相关的数据库配置。 | | version | number | 是 | 数据库版本。 | @@ -91,7 +91,7 @@ deleteRdbStore(context?: Context, name: string, callback: AsyncCallback<void& - 参数: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | context8+ | Context | 是 | 应用程序或功能的上下文 | + | context8+ | Context | 否 | 应用程序或功能的上下文 | | name | string | 是 | 数据库名称。 | | callback | AsyncCallback<void> | 是 | 指定callback回调函数。如果数据库已删除,则为true;否则返回false。 | @@ -116,7 +116,7 @@ deleteRdbStore(context?: Context, name: string): Promise<void> - 参数: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | context8+ | Context | 是 | 应用程序或功能的上下文 | + | context8+ | Context | 否 | 应用程序或功能的上下文 | | name | string | 是 | 数据库名称。 | - 返回值: @@ -660,6 +660,7 @@ greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicates 配置谓词以匹配数据字段为ValueType且value大于或等于指定值的字段。 +**系统能力**:SystemCapability.DistributedDataManager.RelationalStore.Core。 - 参数: | 参数名 | 类型 | 必填 | 说明 | @@ -869,7 +870,7 @@ groupBy(fields: Array<string>): RdbPredicates ### indexedBy -indexedBy(field: string): RdbPredicates +indexedBy(indexName: string): RdbPredicates 配置RdbPredicates以指定索引列。 @@ -1295,6 +1296,8 @@ beginTransaction():void 在开始执行SQL语句之前,开始事务。 +**系统能力**:SystemCapability.DistributedDataManager.RelationalStore.Core。 + - 示例: ``` rdbStore.beginTransaction() @@ -1317,6 +1320,8 @@ commit():void 提交已执行的SQL语句。 +**系统能力**:SystemCapability.DistributedDataManager.RelationalStore.Core。 + - 示例: ``` rdbStore.beginTransaction() @@ -1340,6 +1345,8 @@ rollBack():void; 回滚已经执行的SQL语句。 +**系统能力**:SystemCapability.DistributedDataManager.RelationalStore.Core。 + - 示例: ``` try {