Heyo,
can someone give me a bit help for a dataviewJS query?
I want to create a query for the metadatamenu plug-in, to asign file classes based on a query.
https://mdelobelle.github.io/metadatamenu/fileclasses/#map-with-a-query
My aim is to select all pages where a property (type) has a certain value ([[Test_Link]])
I looked trough the documentation and I assume that I need to use something like:
dv.pages().where(b => b.type == "[[Test_Link]]");
Which is not working…
I think the problem could be following:
I printed the page of the test file and got:
"
- file:
- path: Zettelkasten/Test.md
- folder: Zettelkasten
- name: Test
- …
- …
- type:
- [[Test_link]]
"
- [[Test_link]]
As far as I understand, the query looks for the property “type” and checks if it is equal to “[[Test_link]]”
But in the printed version it seems that “[[Test_link]]” is part of an array(?) underneath of type (I have no prgramming experience…).
I gues what is needed is to look if “[[Test_link]]” is included in type rather than equal to.
I tried
dv.list(dv.pages().where(b => b.type.includes("[[Test_Link]]")));
With no succes either…
Does somebody has an idea how I can achieve this?
I hope I got across my problem! ![]()
Happy about any information ![]()