Querying a lits of Favourite Episodes

Options

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

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    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.