Exclude current file from LIST query

What I’m trying to do

Create a list of all of the main topics, where the outgoing links on every file is a subtopic. The problem is, my query includes the current file (which is simply a MOC) inside the list.

Things I have tried

I tried adding WHERE file.outlinks != this.file at the end of my query but it still includes it.
Here’s the full query:

LIST file.outlinks
FROM (#main-topic AND "COMPUTER SCIENCE/Session_1/FMCS")
WHERE file.outlinks != this.file

The last command should filter out the current file, but it doesn’t.

Try using a this.file.name
I know with my tables of files, I use
WHERE file.name != this.file.name

Looked through some of the docs[1] because I wanted to understand and stop looking this up.

Looks like file.name in my is an “Implicit Field”[2], so like a variable that every file will have a value for, and you can add a prefix such as this. or some other [[fileName]] to get the value of a variable from that file.

So in this case we are saying we want the file.name of this file.
So if file.outlinks (or file.name, in my example) evaluates to not equal (!=) to the file.name of this.file it will be shown.


  1. Dataview ↩︎ ↩︎

  2. Metadata on Pages - Dataview ↩︎