I have a Firebase structure like
categories {
"1234" : {
title : "Object 1",
categories : {
"7654" : {
title : "Object 7",
categories : {
"ABCD" : {
title : "Object A"
}
}
},
"8765" : {
title : "Object 8"
},
"9876" : {
title : "Object 9"
}
}
},
"2345" : {
title : "Object 2"
}
}
Now I want to get all categories incl. the subcategories. My main problem is, that the subcategories (7654, 8765, 9876) is a map (which is internally ordered by the key-hash). But I need to have them in the order by key-values.
Is the only possible way to create the object with DataSnapshot.getValue(MyObject) and to sort it in the client? Or do I need to create my structure in a different way?