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

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

问题描述

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

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);

在这种树中,可以在不覆盖其值的情况下更改ChildOne"的名称.

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

推荐答案

Firebase 数据库无法重命名现有节点.

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天全站免登陆