Query only for moc under a heading

how do i make sure that this query only looks at links in lists that are under the heading # moc

list WHERE !(contains(file.folder, this.file.folder)) and contains(file.inlinks, [[]])

for example

some other header

  • [[an outgoing link that i don’t want to query]]


  • [[link]]
  • [[link2]]
  • [[etc]]

i want the query to look at the links only under the moc header

If your example was in a note of its own, and you only wanted the links under the moc heading, you’d do something like:

TABLE item.text, item.outlinks 
WHERE file = this.file
FLATTEN file.lists as item
WHERE meta(item.section).subpath = "moc"

Note that this depends on the links to be within a list item, so that the item.section is defined to be the closest heading. A variation of this can also be achieved using filter(file.lists, (item) => meta(item.section).subpath = "moc") or similar.

However, I’m not following which files you actually want to check and how you want to filter them. But to limit something related to headings, you need something similar to the examples above.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.