The title of the question could be improved, sorry about that. I have 3 tables: job, skill and job_skill (M:M junction table between job and skill).
I am trying to filter jobs based on a skill but I want to return all skills for a given job that was returned even if these skills were not selected as the filter.
For example: one job X has 5 skills A, B, C, D and E. In my filter, I have skill B. I want the job to be returned to include skill B, of course, but also all its other skills and not only B. Here is my simplified query below.
let skillsArray = [B]
let query = supabase.from('job').select(*,skill!inner(skill_name))
Then, I chain it with:
query = query.in('skill.skill_name', skillsArray);
In the query results, I get job X with only skill B despite job X having also skills A, C, D and E. How can I modify my query such that these skills are also included?
In my console logs, I have these two situations highlighted in job results based on the filter skill ‘spanish’:
The job has only one skill displayed in results despite having multiple:
job: This is a test job
skills: [
{ skill_name: 'spanish' },
]
Here is how I would expect the job to be displayed including its multiple skills:
job: This is a test job
skills: [
{ skill_name: 'spanish' },
{ skill_name: 'api' },
{ skill_name: 'business_consulting' },
{ skill_name: 'mandarin' },
{ skill_name: 'microsoft_excel' }
]