Hello
I have two tables. I know that we cannot perform joins like in relational database. I would like to return the sub elements for each parent record. The database structure is as follows
User-- Parent --Parent -- ID Deck
UserHasIDs-- -- Junction -- Child -- IDs
My goal is to get the child records and display them as a list within the parent list
List 1 Item 1
--Parent record 1
-- Name
-- Junction ID
List 2 Item 1
--Child Record
--Name
--Id
List 1 Item 2
-- Parent record 2
-- Name
-- Junction ID
List 2 Item 1
--Child Record
--Name
--Id
List 2 Item 2
--Child Record
--Name
--Id
I can get the parent and the junction id in the first query.Then in a separate query I can get the Child. (I am using the MongoDB). The issue is that when the result comes back, it updates not just the list item that it is nested in, but the all of the lists in each of the items.
What I am looking for is a way to do a dynamic query for each record returned.
My next step is to push all the elements into local storage and use jquery to write into each listitem. I am hoping there is an easier solution than that.
Thanks for your guidance