Inverted Relation Retrieval

Hi there
I need help

I have 2 Tables, there are Users and quiz_groups

Can I get a query that can get all quiz_groups 1:N in which my user is related?

these are my boards and I have them related like this.

I await your prompt responses

Hi @Jorge_rojas,

I’m not sure I understood your question, so I’ll try to answer two different options.

If you query the quiz_groups table and would like to get all records from the quiz_groups table where users_related includes a specific user, then your where clause should look like the following:

users_related in ('EAE6C107-1B7C-4929-9FDA-E97189807375')

where 'EAE6C107-1B7C-4929-9FDA-E97189807375' is your user’s objectId.

If you query the Users table and would like to get all users that are included in the specific quiz_groups item, then your where clause should look like the following:

quiz_groups[users_related].objectId = '21B4740F-D9FB-4147-A4CB-A5A527982A5D'

where '21B4740F-D9FB-4147-A4CB-A5A527982A5D' is your quiz_groups item objectId.

Hope that helps.

And welcome to our community!

Regards,
Stanislaw

yes thanks, this will help me