Query DB with a referenced field

Hello corvid community. I’m sure I’m not the only one with this problem and I hope someone has the answer, I’ve been searching and reading for three weeks all there is for the function inlcude () and queryReference () in the posts of this forum, in the articles posted by wix and in the API documentation but I haven’t managed to make the query work with the Dropdown. I have two databases, “Team” and “Projects”.
Team’s collection has a referenced field called “projectCoord” that refers to the “Projects” database.
What I want to achieve is to use a dropdown to do a query for the “team” collection and return the referenced field items called “projectCoord” field of the elements that matches the values of the dropdown to my repeater. Thanks in advance if someone has the solution
In this code I’m Using include() function.

export function dropdown1_change(event) {
wixData.query("Team") //Main Data base with a reference field named "projectCoord" referenced to the Projects DB

.include("projectCoord")//Field on the Team DB referenced to the Projects DB

.eq("projectName", $w('#dropdown1').value)//projectName is a field in the Projects DB

.find()
.then( (results) => {
if(results.items.length > 0) {

let items = results.items;
$w('#teamRepeater').data = items;

} else {
$w('#teamTitle').text = "Not Found";
}
} )
.catch( (err) => {
let errorMsg = err;
} );
}

You should know that the reference field actually contains the _id of the record of the Projects collection.
So you’ll need to run 2 queries:
First find the _id in the Projects collection, then use this _id to find the record in Team collection.

Also, check out this example as it might help you too.
https://www.wix.com/corvid/forum/community-discussion/example-wix-data-multiple-references

hello again I hope I can be clear with this post. I already reviewed and rewrote the code of the example with my own databases and data and I am a little clearer on how to work with referenced fields but I still have some doubts and two key issues of this example.
The next block is the function of the code in the example where the table is load with the “Team” collection items but I notice that only this only works with multi reference fields and not single reference field

async function loadTeamCollection() {
let res = await wixData.query('Team')
.include('coordProject')
.find();
$w('#itemsTextBox').value = JSON.stringify(res.items, undefined, '  ');
$w('#itemsTable').rows = res.items.map(item => {
return {
foto: item.photo,
name: item.title,
proyecto: item.coordProject.map(_ => _.title).join(', ')

}
});
}

But okey lets say I’m going to work with multi reference items. The next block is the function of the code in the example where multi referenced query is run (not sure if also works with single reference fields too) but my other issue is that in the .eq(propertyName, value) function of the code for this example “value” has to be predefined, If I want to take the value from a dropdown to perform the query, for example .eq(‘projectName’, $w(#“dropdown1”).value) the code gives me an error.

async function queryReferenced() {
let proyect = (await wixData.query('Projects')
.eq('projectName', 'Project12')
.find()).items[0];
let res = await wixData.queryReferenced('Projects', proyect._id, 'Team');
$w('#queryReferencedTextBox').value = JSON.stringify(res.items, undefined, '  ');
$w('#tableQueryReferenced').rows = res.items;
}