dongqiuqiu4736 2017-01-17 09:02
浏览 189
已采纳

如何使用golang从Firebase获取

Database structure I want to retrive all the data stored in this database using golang

{
 "-KaMY9JKmgyRWVApfcXW" : {
          "EmailId" : "aaa@gmail.com",
          "FirstName" : "abc",
          "LastName" : "xyz",
          "UserType" : "user"
      }
 }
  • 写回答

1条回答 默认 最新

  • dougan1884 2017-01-18 06:02
    关注
        v := map[string]YourStruct{}
        err := dB.Child("YourChild").Value(&v)
        if err != nil {
          log.Fatal(err)
        }
        fmt.Println("%s
    ", v)
    

    Where YourStruct{} is the struct which you use for fetching values. YourChild is the child name of your above code.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?