Query Constraint Based on Related Object

Hi all,

What I’m trying to do is somewhat the other way around of the “Loading a Subset of Related Child Objects” in Data Service API -> Relations(Retrieve).

Here’s a stripped-down schema of my app:
-Guests
–name(String)
–email(String)
–surveys(Relation, One to Many)

-Surveys
–user(String)
–point(String)
–answers(Text)

I can retrieve guests who never took a survey by

where = (surveys IS NULL)

and those who has filled out at least one survey by

where = (surveys IS NOT NULL)

so far, so good.

But, what I also need is to retrieve guests who took a survey in a specific point, with a hypothetical query like

where = (surveys.point = 'Main Kiosk')

If I don’t use relation and simply save the survey info as a json string then my query would be as

where = (surveys LIKE '%"point":"Main Kiosk"%')

Can I do this while still keeping the relations or do you suggest to change my app’s structure?

Thanks for all your help and/or insights…

Best,

~ Fatih

So, awkward enough, my hypothetical (!) query turned out to be working just fine :slight_smile:

I honestly don’t know how it’s failed earlier.