What I’m trying to do
I am struggling to get a basic dataview query working.
I want to build a simple list of all the files in/beneath a directory with a specific tag.
For reference, the queries that I am trying to get working are inside the index.md
file / that is where I want the list generated.
There are only two .md
files in the directory and of the two, only the some title here.md
has the worklog
as a tag.
The dataview query should return only one result: some title here
.
Here’s how things look on disk:
❯ cd $vaultRoot/Path/Example/Here
❯ tree .
.
├── _files
│ └── <a bunch of things that are not important here>
├── some title here.md
└── index.md
# Now lets take a look at the file that has the tag of interest
❯ head some\ title\ here.md
---
aliases:
- some-title-here
tags:
- some
- things/that/dont/matter
- worklog
created: 2022-10-...
modified: 2022-10-...
---
FileContentHere ...
Things I have tried
In the index.md
I have tried:
LIST
FROM "Path/Example/Here"
WHERE contains(tags, "worklog")
This returns NOTHING.
LIST
FROM "Path/Example/Here" and "#worklog"
This returns NOTHING.
LIST
FROM "Path/Example/Here" and "worklog"
This returns NOTHING.
But here’s the odd bit. THIS QUERY:
LIST
FROM "Path/Example/Here"
returns one result: index.md
See the tree
output above… there are TWO files in the Path/Example/Here
directory!
Up until that last query, I wasn’t sure that tags done in front matter like i’ve done were supported… but this GH issue seems to imply that they are supported and the queries SHOULD work:
But the query with a basic “from $folder” returning only 1/2 of the folder content makes me think that something more fundamental is broken / wrong.