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 7bdf266005de24e58e1f0f7e8fa92eaaba63842d..59a20532a4e500339d02046fa78b367eab219f46 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 实例的节点,提供定义存储在数据库中的值的方法。