Greetings,
In firebase I have this db example:
{ "fruits" : ["apple", "banana", "lemon", "orange",], "house" : { "id01" : { "fruit" : 1, "color" : 2 }, "id02" : { "fruit" : 2, "color" : 4 }, "id03" : { "fruit" : 3, "color" : 6 }, }, "color" : [{ "yellow" : {1,1,0} }, { "black" : {0,0,0} }, { "red" : {1,0,0} }, { "green" : {0,1,1} }], }
How proceed this?
I have a data “id01”, and it contain: { “fruit” : 1, “color” : 2 },
How get?
fruits: banana
color: red, {1,0,0}
I am newbie in this case… Sorry.
This is?
firebaseDatabase.get( "house/id01" .. invite, function (ev) if(ev.isError) then label1.text = "Err\n[" .. json.encode( ev ) .. "]" else label1.text = "Ok\n[" .. json.encode( ev ) .. "]" local house = ev.data label2.text = "app\_config\n[" .. json.encode( app\_config ) .. "]" firebaseDatabase.get( "fruits/" .. house.fruit, function (ev) if(ev.isError) then label3.text = "Err\n[" .. json.encode( ev ) .. "]" else label3.text = "fruits\n[" .. json.encode( ev ) .. "]" local fruits = ev.data label4.text = "fruits[" .. fruits .. "]" end end end firebaseDatabase.get( "color/" .. house.color, function (ev) if(ev.isError) then label5.text = "Err\n[" .. json.encode( ev ) .. "]" else label5.text = "color\n[" .. json.encode( ev ) .. "]" local color = ev.data label6.text = "color[" .. color .. "]" end end end end end )