You can … by accessing the properties object available on file
… as stated somewhere here: Bases syntax > File properties
| Property | Type | Description |
|---|---|---|
file.properties |
Object | All properties on the file. Note: Does not automatically refresh results when the vault is changed. |
When coercing a link into a file within filter() or map(), for example, only the implicit keys ( file.name, file.size, etc…) are accessible directly…
So if you need to access keys stored in YAML/Properties, you can dereference them from the file.properties object.
So, as you’ve seen, this doesn’t work…
While this should…
file.links.filter(value.asFile().properties.parents.contains(this.file.name)).length > 0
Now, I’m not invalidating your request
, as it is indeed not necessarily easy to loop through some levels of parent/child structure (example 1 and in the same topic: example 2… Although the use case is different from the one here, I think the principles would still apply
) but I feel like the premise isn’t the right one ![]()
A big side note regarding this:
file.properties has only been implemented in Obsidian 1.9.7 (Obsidian 1.12.7 is the latest public release)
So if you can, you might want to update Obsidian (and/or its installer (on desktop)) ![]()