It would be incredible to be able to query for all notes with certain backlinks using regex.
I'm aware that there's recently been support for something like: list where contains(file.inlinks, [[filename]])
But I'd like to generate a list of notes that have backlinks that match a certain regex query. Currently, this doesn't work: list where regexmatch(file.inlinks, "^Meeting with .+"
This query, if it worked. would give me a list of people who I've had meetings with
Even better would be some way to assess the tags of all the file.inlinks: list where contains(file.inlinks.tags, "#meeting"
Perhaps this would only be useful if there was a forEach function or an array.map() function of sorts list where length(file.inlinks.filter(inlink => contains(inlink.tags, "#meeting"))) > 1
The text was updated successfully, but these errors were encountered:
timconnorz
changed the title
Query for notes based on their backlinks
Query for notes based on their backlinks / for loop
Apr 23, 2021
timconnorz
changed the title
Query for notes based on their backlinks / for loop
Query for notes based on a regex match against its backlinks / for loop
Apr 23, 2021
Yeah, the main downside to the declarative nature of dataview is that it's awkward to handle arrays in an intuitive way. Adding lambdas and additional array functions seems like a good idea.
As for the links, I'm looking into making string methods work naturally on links - or at the very least, being able to convert links to strings easily via a string() function.
I'm also interested in using regex on the inlinks and outlinks. Namely, I'm trying to get a list of all notes who have an inlink that contains "&" in the title. Any idea how to do this?
Anyway, I haven't looked at this issue in quite some time, but I think almost all of this is achievable in normal dataview. You can use string() to convert a link into it's textual representation, and there are now any, map, filter, all, and join operators for doing some array operations.
Going to close this as "fixed" since this is achievable (and is also doable in DataviewJS).
It would be incredible to be able to query for all notes with certain backlinks using regex.
I'm aware that there's recently been support for something like:
list where contains(file.inlinks, [[filename]])But I'd like to generate a list of notes that have backlinks that match a certain regex query. Currently, this doesn't work:
list where regexmatch(file.inlinks, "^Meeting with .+"This query, if it worked. would give me a list of people who I've had meetings with
Even better would be some way to assess the tags of all the file.inlinks:
list where contains(file.inlinks.tags, "#meeting"Perhaps this would only be useful if there was a forEach function or an array.map() function of sorts
list where length(file.inlinks.filter(inlink => contains(inlink.tags, "#meeting"))) > 1The text was updated successfully, but these errors were encountered: