My database object is structured like this:
{
user_name: 'string',
skills: [
{ skill: 'skill1', lvl: 3 }
],
wantsToLearn: [
{skill: 'skill2' }
]
}
I am trying to create a query that will allow me to find users who have a desired skill matching one of the skills my input user has (regardless of level) and vice versa. Essentially, I want to locate all users with a common skill or desire to learn something new.
Despite referencing the mongodb documentation, I am struggling to determine the most efficient approach for achieving this. My experience with databases is limited, mainly in SQL.
Any advice on how to tackle this issue would be greatly appreciated!