In my app I want to give the users the possibility to make their own lists. For the sake of a easy example, imagine your standard list app. The users can create their own custom lists, and put what ever they want in it. I want the users to be able to search all lists to see if an item is in it. For example milk could both be in a grocery list, and a recipe for pancakes. So in this example I would like to search all the lists a user has made, and get back the name of the lists that contains milk
I currently have a Firebase structure like this:
{
"userLists" : {
"vBbYFkxrj8UTmBiUxKsjNSw8YBs2" : {
"groceryList" : {
"82654829" : {
"amount" : "1",
"objectName" : "Milk"
},
"72819278" : {
"amount" : "1",
"objectName" : "Banana"
},
"83917362" : {
"amount" : "2",
"objectName" : "Apple"
}
},
"pancakeRecipe" : {
"12986530" : {
"amount" : "1",
"objectName" : "Milk"
},
"1087527" : {
"amount" : "1",
"objectName" : "Flour"
},
"10985255" : {
"amount" : "1",
"objectName" : "Egg"
}
},
"To do" : {
"12984762" : {
"objectName" : "Mow lawn"
},
"12984762" : {
"objectName" : "Wash car"
},
"98129854" : {
"objectName" : "Pay bills"
},
}
},
"users" : {
"vBbYFkxrj8UTmBiUxKsjNSw8YBs2" : {
"Address" : "Kings Road 123",
"Email" : "a@a.no",
"Name" : "John Doe",
"Phone" : "11223344"
}
}