如何在Firebase实时数据库Android中基于另一个节点更新特定节点 [英] How to update a specific node based on another node in firebase realtime database android

查看:72
本文介绍了如何在Firebase实时数据库Android中基于另一个节点更新特定节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个孩子的父节点.当我尝试从一个节点更新一个子节点时,另一个子节点也应更新.例如,当我从一个节点将time_slot(子节点)09:00 AM更新到10:00 AM时,它也应该在另一个节点中反映出来. 就像在sql数据库中的外键概念一样.如果我们更新一个主键值,那么它将在引用它的另一张表中更新

I have two parent node with some child. when i try to update one child from one node then another child node also should update. for example when i update time_slot (child node) 09:00AM to 10:00AM from one node then it should reflect in another node also. Like in sql database foreign key concepts. if we update one primary key value then it will update in another table in which it is referred

推荐答案

Firebase 是一个noSQL数据库.因此,您不能在这里期望SQL类型的行为. 您可以在此处执行的操作是直接从移动应用程序更新两个节点.第二个选择是使用 Cloud Functions 触发数据库事件.

Firebase is a noSQL database. So you cant expect SQL type behavior here. What you can do here is update both nodes directly from your mobile application. Second option is use Cloud Functions to trigger a database event.

要了解云功能,请浏览.

To understand cloud functions please go through this .

这篇关于如何在Firebase实时数据库Android中基于另一个节点更新特定节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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