【问题标题】:Couchbase Lite - synchronising reference fieldsCouchbase Lite - 同步参考字段
【发布时间】:2016-10-10 02:21:30
【问题描述】:

在使用 Sync Gateway 与 Couchbase Server 同步时,Couchbase Lite 如何处理 Ottoman's ref 字段?

试图让自己熟悉 Couchbase,在观看和阅读了 Couchbase Server 和 Couchbase Lite 组合(This videothis tutorialand official docs)之后,我不明白 Lite 如何反映服务器中定义的数据模型.

在我看来,Lite 和 Server 不太相似,尽管它们都代表 NoSQL 数据库。您以不同的方式定义、存储和处理数据 - 看起来 - 不同的方式。尽管如此,同步网关仍然允许 Lite 与服务器同步。

主要问题来了 - 在基于 Ottoman 的服务器 (check Model References here) 中定义的 ref 字段如何在使用 Sync Gateway 同步时反映在 Lite 中?

如果我只是理解 refs 或同步的概念完全错误,请纠正我。

【问题讨论】:

    标签: node.js couchbase couchbase-lite couchbase-sync-gateway couchbase-ottoman


    【解决方案1】:

    Couchbase Server 和 Couchbase Mobile 的文档模型非常相似。主要区别在于 Couchbase Mobile 将带有“_”前缀的字段保留为元数据。除此之外,它们都提供以字符串键命名的 JSON 文档。

    我对 Ottoman 一无所知,但听起来 'ref' 字段只包含一个字符串,它是目标文档的 ID。两者都一样。

    知道的是 Ottoman 在文档中使用了一个名为 _type 的字段名称,这使得它与 Couchbase Mobile 不兼容。 Sync Gateway 将拒绝包含以下划线前缀的属性的文档。我不知道是否有办法告诉 Ottoman 使用不同的属性名称。

    【讨论】:

      猜你喜欢
      • 2015-11-16
      • 2018-04-06
      • 2016-11-02
      • 1970-01-01
      • 2016-02-18
      • 1970-01-01
      • 1970-01-01
      • 2018-03-04
      • 1970-01-01
      相关资源
      最近更新 更多