I'm trying to create a database in Firebase...
I'd like to change this 'zero' level in this database to 'StudentsList' but have no idea how to do it:
Could someone please show me the syntax to change that root level of the JSON please?
This is what I currently have:
[ { "Gender" : "Male", "NameOfStd" : "Karachi Boi", "RollNo" : "10", "Section" : "b" } ]
Thanks
CodePudding user response:
{"StudentsList" : { "Gender" : "Male", "NameOfStd" : "Karachi Boi", "RollNo" : "10", "Section" : "b" } }
"[]" indicate an array (so with integer index) whilst "{}" indicate a dictionary.
if you want a list of student the answer should probably be :
{"StudentsList" : [{ "Gender" : "Male", "NameOfStd" : "Karachi Boi", "RollNo" : "10", "Section" : "b" }] }
which will give you this :