I have a collection of jobs that have certain skills. Please see the pic below.
As you can see each "job" object has a "skills" array. Skills are shared between different jobs, thus I need to write a get request, so that when a user clicks a skill, it shows different jobs that require this skill. Could you please help me with that. I wrote a code but it does not work.
There are 32 documents overall, each document looks something like this. It has a job name and array of skills.
Some jobs share the same skills. For example IT Business Analyst and Business Analyst.
While some jobs share only jew ones. For example, Business Analyst and Technical Manager share "Communication" skill.
An output is array of documents that share the same skill. For example array of "Business Analyst" and "Teachnical Manager" objects since they share "Communication" skill.
[
{
"name": "Business Analyst",
"category": "Analyze",
"skills": [
{
"name": "Listener",
"id": "1"
},
{
"name": "Critical Thinking",
"id": "2"
},
{
"name": "Problem Solving",
"id": "3"
},
{
"name": "Analytical",
"id": "4"
},
{
"name": "Communication",
"id": "5"
},
{
"name": "Documentation",
"id": "6"
},
{
"name": "Research",
"id": "7"
}
]
},
{
"name": "Technical Manager",
"category": "Management",
"skills": [
{
"name": "Team Management",
"id": "8"
},
{
"name": "Mentorship",
"id": "9"
},
{
"name": "Decision Making",
"id": "10"
},
{
"name": "Strategic Thinking",
"id": "11"
},
{
"name": "Negotiating",
"id": "12"
},
{
"name": "Communication",
"id": "5"
},
{
"name": "Financials",
"id": "13"
}
]
}
]