从Firebase检索不使用自动生成的ID本地响应

时间:2017-09-10 19:00:42

标签: firebase react-native

您好我在反应原生中使用此函数从firebase检索数据,并且当节点标题为1或任何其他数字时,它可以正常工作。但是当我使用push时,firebase将自动生成一个像Kth6q9p8njLyfwbuyL5这样的id,当我无法在本机中检索时。有谁知道为什么?谢谢你的帮助

let shiftPath = "/shifts/mobile";

firebase.database().ref(shiftpath).on('value', (snapshot) => {

        this.setState({
          mobile : snapshot.val(),
            });
          });



    }

it works with 2 and not with Kth6q9p8njLyfwbuyL5

1 个答案:

答案 0 :(得分:0)

它们都相同,但第一个有UUID

enter image description here

相关问题