we inherited a old database structure w/c stores colors as arrays in firebase realtime database
As you can see from the figure, index 5 is missing since it was set to null and firebase don't store null values
The problem with this is as you can see, index number 5 is missing since firebase doesn't store the values of array elements with null values.
For example: colorCodes[5] = null;
The problem is when we fetch the colors, it returns an array value and loses it's correct index information.
Let's say i store the fetched colors in colors array and looking at colors[5] would then return a value since firebase just returns a simple array NOT containing the original indexes.
Is there a way to return a object instead of array so it still points to the correct indexes so the color on index 5 would still return null.


