You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we've learned the five operators let's flex our muscles and write some powerful queries.
984
+
985
+
When information is organized hierarchically, parent hold references to their children. In relational systems like databases, children hold references to their parents. Both ways of organizing information are equivalent, and depending on the circumstances we might get data organized in one way or another. It may surprise you to learn that you can use the methods you already know to easily convert between these representations. In other words, not only can you transform trees into lists, you can transform lists into trees.
986
+
987
+
We have 2 lists each containing lists, and videos respectively. Each video has a listId field indicating its parent list. We want to build a list of movie list objects, each with a name and a videos array. The videos list will contain the video's id and title. In other words we want to build the following structure:
Let's try creating a deeper tree structure. This time we have 4 seperate lists each containing movie lists, videos, boxarts, and bookmarks respectively. Each object has a parent id, indicating its parent. We want to build a list of movie list objects, each with a name and a videos array. The videos list will contain the video's id, title, bookmark time, and smallest boxart url. In other words we want to build the following structure:
0 commit comments