From 97be56b0ae34794d556dcc39d19fe10d3da3d811 Mon Sep 17 00:00:00 2001 From: asfasdff Date: Mon, 27 Dec 2021 15:55:32 +0800 Subject: [PATCH] api update Signed-off-by: asfasdff --- .../apis/js-apis-distributed-data.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md b/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md index 7bdf266005..59a20532a4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md +++ b/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md @@ -1163,6 +1163,46 @@ KVStore常量。 +## Schema ## + +表示数据库架构,可以创建 Schema 对象,并在创建或打开数据库时将其放置在 Option 中。 + +### toJsonString ### + +toJsonString():string; + +获取 json 格式的 schema 。 + +- 返回值: + + + + + + + + + + +

类型

+

说明

+

string

+

以 json 格式返回Schema。

+
+ +- 示例 + + ``` + try { + let schema = new ddm.Schema(); + const str = schema.toJsonString(); + schema.root = new ddm.FieldNode(); + const node = schema.root; + console.log("schema: " + str); + } catch (e) {} + ``` + + ## FieldNode ## 表示 Schema 实例的节点,提供定义存储在数据库中的值的方法。 -- GitLab