While I initially passed an array to Firebase to store data, it proved to be inefficient when querying the data. As a result, I am now considering storing the data in mapping format. However, I am unsure of how to proceed with this.
{
"ClassDetails":
[
{
"Code": "CIS695",
"Instructor": "Dr. Antony",
"Location": "BB444",
"Name": "Capstone project"
}
],
"PersonalDetials": [
{
"Email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2b0b1aaa3aaf082afb7b0b0a3bbb1b6a3b6a7eca7a6b7">[email protected]</a>",
"FName": "Ravi",
"LName": "Shah",
"Major": "MSIS"
}
]
}
I aim to restructure the data into the following format:
{
"ClassDetails":
"CIS695":{
"Code": "CIS695",
"Instructor": "Dr. Antony",
"Location": "BB444",
"Name": "Capstone project"
}
"CIS690":{
"Code": "CIS690",
"Instructor": "Dr. Smith",
"Location": "BB444",
"Name": "Project Management"
}
"PersonalDetials":
{
"Email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ccbebfa4ada4fe8ca1b9bebeadb5bfb8adb8a9e2a9a8b9">[email protected]</a>",
"FName": "Ravi",
"LName": "Shah",
"Major": "MSIS"
}
}
Despite trying various methods, a proper solution has eluded me.Here is the current data structure in Firebase