I'm having trouble retrieving a list of items from Firebase, where each item contains a list of related items. I've attempted to use both firebase-util and the firebase array $extend feature without success.
The structure of my Firebase data is as follows:
items
item1
name: "Item 1"
user: user1
images
image1: true
image2: true
item2
name: "Item 2"
user: user1
images:
image3: true
image4: true
item3
name: "Item 3"
user: user2
images:
image5: true
image6: true
users
user1
name: "User 1"
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="27525442551667424a464e4b0944484a">[email protected]</a>"
user2
name: "User 2"
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dfaaacbaaded9fbab2beb6b3f1bcb0b2">[email protected]</a>"
images
image1
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
image2
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
image3
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
image4
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
image5
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
My goal is to retrieve a list of items with all associated data structured like this:
items
item1
name: "Item 1"
user
name: "User 1"
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bbcec8dec98afbded6dad2d795d8d4d6">[email protected]</a>"
images
image1
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
image2
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
item2
name: "Item 2"
user
name: "User 1"
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cabfb9afb8fb8aafa7aba3a6e4a9a5a7">[email protected]</a>"
images
image3
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
image4
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
item3
name: "Item 3"
user
name: "User 2"
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="73060016014133161e121a1f5d101c1e">[email protected]</a>"
images
image5
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/...
image6
image: "data:image/jpeg;base64,/9j/..."
thumb: "data:image/jpeg;base64,/9j/..."
While this seems like a common scenario, I am facing challenges in implementing it. I have explored a solution similar to this but without any success due to the nested nature of the lists.