如何在Unity中重命名Firebase中的节点 [英] How to rename nodes in Firebase from Unity

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

问题描述

我在我的应用程序中使用Firebase-Unity测试工具来获取实时数据。我想更改树中的节点名称而不覆盖其子节点。例如:

  IFirebase firebase; 
firebase = Firebase.CreateNew(https://test1.firebaseio.com/someChild);
firebase_Rank.Child(ChilOne)。SetValue(1);
firebase_Rank.Child(ChilTwo)。SetValue(2);
firebase_Rank.Child(ChilThree)。SetValue(3);

在这种树中,可以更改ChildOne的名称而不覆盖它的值。 Firebase数据库无法重命名现有节点。




$ b

解决方案

大多数开发人员通过用新名称插入节点的副本,然后删除旧节点来完成重命名。


I am using Firebase-Unity beta tool for real time data in my app. I want to change node names in the tree without override its children. For example:

    IFirebase firebase;
    firebase = Firebase.CreateNew ("https://test1.firebaseio.com/someChild");
    firebase_Rank.Child("ChilOne").SetValue(1);
    firebase_Rank.Child("ChilTwo").SetValue(2);
    firebase_Rank.Child("ChilThree").SetValue(3);

In this kind of tree is it possible to change the names of "ChildOne" without override it's value.

解决方案

The Firebase Database has no way to rename an existing node.

Most developers accomplish a rename by inserting a copy of the node with the new name and then deleting the old node.

这篇关于如何在Unity中重命名Firebase中的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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