Great article, I was really confused at the beginning. However, the magic happens.
I store a JSON file to firebase,
{
"guest": {
"randomGidForGuestOne":{
"gid": "randomGidForGuestOne",
"guestAndPlusOneNumber": "1",
"guestAndPlusOneList":{"0": "randomGidForGuestOne","1":"randomGidForGuestTwo"},
"gImage":"gs://fir-databasepra.appspot.com/guestImage/randomGidForGuestOne.png"
},
"randomGidForGuestTwo":{
"gid": "randomGidForGuestTwo",
"guestAndPlusOneNumber": "0",
"guestAndPlusOneList":{"0": "randomGidForGuestTwo"}
}
}
}
and got back a dictionary with array in snapshot. So it looks like this
{
"guest": {
"randomGidForGuestOne":{
"gid": "randomGidForGuestOne",
"guestAndPlusOneNumber": "1",
"guestAndPlusOneList": ["randomGidForGuestOne","randomGidForGuestTwo"],
"gImage":"gs://fir-databasepra.appspot.com/guestImage/randomGidForGuestOne.png"
},
"randomGidForGuestTwo":{
"gid": "randomGidForGuestTwo",
"guestAndPlusOneNumber": "0",
"guestAndPlusOneList":{"0": "randomGidForGuestTwo"}
}
}
}
Supper cool!!! Detail please see github.
https://github.com/lingzt/FirebaseDatabasePra/commit/e282cac346e747b22a669d26d000bb7e84caecb3
No comments:
Post a Comment