Firebase中的交叉点 [英] Intersection in Firebase

查看:115
本文介绍了Firebase中的交叉点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请注意firebase中的以下数据结构:

 产品
+ p1
+ name
+标签
+ t1
+ t2
+ p2(类似于上面的p1)
标签
+ t1
+ p1(p1是product-id)
+ p2
+ t2
p3
p1
+ t3
p4
p2
ref / tags />
$ tag )会给我的产品列表。然而,如何实现/查询两个或多个标签的交集?我愿意以最好的方式修改数据结构。



所以我真正想要查询(因此存储数据)的是查询

 获得匹配标签1,标签2和标签3的产品

我需要以运行我自己的服务器来做到这一点?
是否可以在Firebase中自动汇总数据

解决方案

在Firebase Developer Summit 2016中引入客户端加入和交叉引擎,文档和教程即将发布。


Please consider the following data structure in firebase:

products
  + p1
    +name
    +tags
      +t1
      +t2
  + p2 (similar to p1 above)
tags
  +t1
    +p1 (p1 is the product-id) 
    +p2
  +t2
    p3
    p1
  +t3
    p4
    p2

I understand that if I wanted to query products by tag - the above structure would be useful (ref /tags/$tag) will get me the list of the products.

However, how do I implement / query for intersection of two or more tags? I am open to modifying the data structure to the do this in the best way.

So what I really want to query (and therefore store data) for is the query

get products that match tags 1, tags 2 and tags 3 

Would I need to "run my own server" to do this? Is it possible to automatically aggregate data in Firebase

解决方案

Please wait some more time as Client side joining and and intersection are introduced in the Firebase Developer Summit 2016, it's documentations and tutorials will be available soon.

这篇关于Firebase中的交叉点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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