What I’m trying to do
I’m trying to use dataviewjs to recover metadata from files that are “inlinks” to files returned by a dataviewjs query.
Things I have tried
I’ve been able to successfully get the initial files that are link targets via the following:
dv.list(dv.pages('"food/dishes"'));
(As you can see, these are all the files in the “food/dishes” folder.)
Having obtained objects representing the metadata in those files, I now want to filter them by metadata contained in other files that link to the files returned by this starting query.
I can see from the output of the above that dv.pages('"food/dishes"')
returns a data array of file objects that each have an inlink attribute. So, when I do
dv.list(dv.pages('"food/dishes"').file.inlinks);
I get the list of files linking to these pages that contain the metadata on which I wish to filter. Great!
But this is the point at which my understanding of dataviewjs seems to reach it’s limit.
It seems from the output I’m getting that dv.pages('"food/dishes"').file.inlinks
returns links to the files I want, not what I actually need, which is a objects representing those files through which I can access their metadata.
For instance, each file in the inlinks
has a date field in it’s metadata. But
dv.list(dv.pages('"food/dishes"').file.inlinks.file.date);
doesn’t return anything! (Evidently, dv.pages
returns an array of objects, but dv.pages.file.inlinks
just returns strings?)
Can you help me understand how to access the metadata at the files linked to by the links returned from dv.pages('"food/dishes"').file.inlinks
?
Thanks!