Using Dataviewjs to filter a table on a YAML property containing an active link

What I’m trying to do

I am trying to create MOCs for certain types of notes. The YAML property (parent) has a link to a document ( “[[+ TestPage]]” ). I just want the table to show the files that have this property.
This is the code as it stands now, which I pieced together, and the forum helped refine it previously.

let docs = dv.pages().filter(doc => doc.parent ===  '[["+ TestPage"]]');
var randos = (docs) => {return docs.sort(() => .5 - Math.random()).slice(0,10);}

dv.table(["Note", "Date Modified", "Progress"], randos(docs)
  .sort(k => k.summary_progress, 'asc')
  .sort(s => s["date modified"], 'asc')
  .map(d => [d.file.link, moment(d["date modified"]).format('MMM DD, YYYY'), d.summary_progress] ))

Things I have tried

I don’t know enough about coding to know what I’m doing wrong. I’ve tried several attempts to target the property correctly. I’ve checked the forum, the internet, and ChatGPT. Nothing has worked.

Hello,

To filter notes by a specific parent link in Dataview, adjust your filter to check the path of the linked note. If parent is a single link, use doc.parent && doc.parent.path === "YourTargetNote". If parent could be an array of links, use doc.parent && (Array.isArray(doc.parent) ? doc.parent.some(p => p.path === "YourTargetNote") : doc.parent.path === "YourTargetNote"). Ensure “YourTargetNote” matches the exact filename (case-sensitive) of the linked document. You can inspect the parent property’s data type with a simple Dataview table for more clarity.

Best regards,
Veronica