I want to create a MOC note with all mentions/links to files that have not been created yet to see what I still need to create. Ideally I would like to sort these by # of links to that term to know what to focus on first/the most.
Things I have tried
I’ve been playing around with dataview but can’t seem to get it working.
This should do it. But a warning before you run it:
If you have even a moderate number of outlinks in your vault, I strongly recommend limiting the query at the FROM line—that I commented out—by inserting a FROM and/or WHERE to a manageable section of your vault.
I put in a redundant filter (the first WHERE) to reduce the processing required in the next two lines, but it could still take a while to look through a ton of outlinks.
```dataview
LIST length(rows)
//FROM "your/folder"
WHERE any(file.outlinks, (o) => !contains(meta(o).path, "."))
FLATTEN file.outlinks AS o
WHERE !contains(meta(o).path, ".")
LiMIT 200
GROUP BY o AS "uncreated file"
SORT length(rows) DESC
```
The LIMIT is there mostly for length readability. Upping it or removing it shouldn’t slow things down significantly unless your list is super long; nevertheless, incremental increases are probably the safer path.
The uncreated links list is stored in the metadataCache as unresolvedLinks. So listed belows are two approaches dealing with this list of links to the uncreated notes. Note that the main key of that list is the note holding the uncreated note/link, so to get what you want one do need to switch it around.
The first links the uncreated note with the origin of the link, and the same is repeated in a slightly different context in the other post. To get just the count you could change the line towards the end which handles the print out to become:
Thank you! This works perfectly. Currently don’t have that big of a vault (less than 1k notes) so it’s still manageable but good comment to filter out certain folders.