I have a bunch of projects in my database, and I'd like to place them into 4 separate groups.
At first, I made four different groups and then just placed each project into the corresponding group. But when I add them into Google Firebase through my JSON structure, it automatically gives each of them the id of '0', '1', '2' etc.
This poses a problem because when I try to use lunr.js, I require to keep a store dictionary that holds each reference name and its information inside it. Like this:
var doc={
name: snapshot.val().name;//This will be '0', '1', '2' etc.
}
store[doc.name] = {info: here} //Which will keep overwriting old files inside this store
I have a global store[ ] dictionary that will hold all the projects, but my JSON has a structure like this:
{
featured{
0{...},
1{...},
},
other{
0 : {...},
1 : {...},
2 : {...}
}
}
I go through each group (featured, other etc.) and add them to my index, but the store[ ] dictionary is overwritten since they have the same keynames.
This tells me my JSON structure is a little flawed, so is there a better way to structure it?