Firebase在子循环中检索单个值

时间:2016-07-05 04:28:34

标签: swift firebase firebase-realtime-database

当我在循环中打印子项时,我正在使用.ChildAdded从Firebase中检索一些项目我看到了所有的键和值,它们都是以快速问题开始的,当我走向头部时{{1}我收到系统错误。我该如何解决这个问题

来自循环的Firebase子结果打印*我想仅检索'年龄'*

print(child.value["myKeyhere"])

我的代码

    Snap (age) 54
    Snap (email) User1@gmail.com
    Snap (firstname) User2Firstname
    Snap (lastname) User2Lastname
    Snap (profilePic) users/profilePhoto/fKNTGRGfmgdZwtHUyJxOjnKXZzx2.jpg
    Snap (receivePostRequest) {
        lat = "37.32550194";
        long = "-122.01974475";
        status = 1;
        tags =     {
            beauty = 0;
            heathcare = 0;
            house = 1;
            housekeeper = 0;
            scholar = 0;
            student = 0;
        };
    }

1 个答案:

答案 0 :(得分:0)

child.value [ “myKeyhere”]作为!串