如何在Firebase中只读取一个子键/值?

时间:2017-07-26 15:39:56

标签: objective-c firebase firebase-realtime-database

所以我正在使用firebase数据库构建一个应用程序,并且有一部分我只想接收每个用户的某些属性。请允许我解释一下。这是我的数据结构:

{
  "Users" : {
    "JuBgk9ZjdrbP5fZVfmhdpF1FrjE3" : {
      "birthday" : 857278800,
      "email" : "*******@sas.upenn.com",
      "full name" : "Neil Doe",
      "gender" : "Female",
      "gender_age" : 220,
      "long bio" : "My name is Neilette, I wanna skoodlypoop you.",
      "short bio" : "Life is actually cake!",
      "username" : "Neildoe"
    },
    "QGqcGWCchCeFKQ6VTAgt9O2v3gs1" : {
      "birthday" : 926395200,
      "email" : "*******@yahoo.com",
      "full name" : "John Doe",
      "gender" : "Female",
      "gender_age" : 218,
      "username" : "Johndoe"
    }

}

是否可以只收到每个用户的全名和生日?或者我是否必须提取全套数据?或者我应该像this answer中那样构建我的数据?

我在目标c中这样做,但任何语言的答案都会有所帮助!

0 个答案:

没有答案