You need to use code for that.
You can create an afterQuery hook for the Children collection to retrieve their parentId (you’ll need to have there .include() ).
Something like:
//backend/data.js
import wixData from 'wix-data';
export function Children_afterQuery(item, context) {
retrun wixData.query(Children)
.eq("_id", item._id)
.include("parents")
.find()
.then(r =>
if(r.items.length > 0){
item.parents = r.items[0].parents;
}
return item;
})
}
and in the front end use code to filter based on the id;
There’re other ways to it, but they all need code.