加入json商店的两个系列 [英] joining two collections in json store

查看:154
本文介绍了加入json商店的两个系列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在JSONStore中加入两个集合?

Is it possible to join two collections in JSONStore?

我想访问json商店中给定的两个集合中的数据,其中一个集合具有外键。

I want to access data from the given two collections in the json store one of which has a foreign key.

推荐答案

在JSONStore的关系数据库中,没有任何东西等同于 join 。但是,像Namfo在另一个答案中所说,你可以利用 additionalSearchFields 来处理这个用例。它允许您索引不属于所存储数据的值的值。例如,如果您有一个订单集合并且正在存储像 {item:'knife'} 这样的对象,那么您可以拥有 customer_id 的附加搜索字段,它引用客户 id 搜索字段c $ c>收藏。 此处是解释其他搜索字段的帖子。

There's nothing equivalent to a join in Relational Databases for JSONStore. However, like Namfo said in the other answer, you may take advantage of additionalSearchFields for this use case. It allows you to index values that are not part of the data being stored. For example, if you have a order collection and are storing objects like {item: 'knife'} you could have an additional search field for customer_id which references an id search field in the customer collection. Here is a post that explains additional search fields.

这篇关于加入json商店的两个系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆