按字段加入非主键的字段(Join document by field that is not a primary key)

编程入门 行业动态 更新时间:2024-10-28 17:17:34
字段加入非主键的字段(Join document by field that is not a primary key)

我有一个在我的平台上创建文档(订单)的外部系统。 我的平台的引用是通过字符串代码维护的,字符串代码不是主键。 所以,我有以下实体:

{ docType: "submission", code: "XPTO28", name: "test-sub" } { docType: "order", code: "XPTO28", value: "100$" }

是否有任何查询将订单文档与提交文档关联而不使用主键,或者我必须以编程方式执行此操作吗?

I have an external system that creates documents (orders) on my platform. The reference to my platform is maintained through a string code, which is not a primary key. So, I have the following entities:

{ docType: "submission", code: "XPTO28", name: "test-sub" } { docType: "order", code: "XPTO28", value: "100$" }

Is there any query to associate order documents to submission documents without using primary keys, or must I do so programatically?

最满意答案

你必须以编程方式进行。 N1QL中的联接目前仅限于将字段(或可以从字段重建的内容,例如,连接前缀)链接到连接的密钥空间的主键。

You have to do it programatically. Joins in N1QL are currently limited to linking a field (or something that can be reconstructed from a field, eg. concatenating a prefix) to the primary key of the joined keyspace.

更多推荐

本文发布于:2023-08-02 12:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1375391.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   主键   Join   document   primary

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!