Querying a lits of Favourite Episodes
Hi, I have an app with meditations in it. Users are able to favorite their meditations. I have that functionality working. What I'm having trouble with is creating an endpoint that returns a list of all of the authenticated users favorite meditations.
I've tried using joins as well with no luck. Currently, I have a field in the user table that is a list of their favorites by meditation.id.
Any help is appreciated, thanks!
Answers
-
Three ways to do it:
1) A join from user to meditation on favmeditation_id to id
2) An addon where you query user, and then addon the meditations from the favmeditation_id
3) Just run two queries. First get the favmeditation_id from user, and then feed that as a filter (using the IN operator) to meditation.
In most cases you won't appreciate a performance difference among these - and when you do you will probably have a lot more experience to make tuning easier.
This kind of multidimensional data management question is something we handle as part of our "hardest 5%" focus in our State Change office hours and forum discussions.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback