Open Davve37 opened 8 months ago
The current results are generated with dataview, so this would be a breaking change.
The current results are generated with dataview, so this would be a breaking change.
Can you just extend the dataview input/return to include the .where
attribute?
I am not sure I get what you mean. Could you elaborate?
I am not sure I get what you mean. Could you elaborate?
optionQuery("Glossary")
is equivalent to dv.pages('"Glossary"').
I am asking if the .where
can be used in addition to the dv.pages argument.
Like this:
dv.pages('"Glossary"').where(p => p.fileClass == 'Dimensions');
That could actually work, the only downside is that this would require users to write JS expressions.
That could actually work, the only downside is that this would require users to write JS expressions.
The where
works the same in datviewjs as it does in normal DQL, but DQL does have less words.
The query would be:
FROM "Glossary"
Where contains(fileClass, "Dimensions")
The where works the same in datviewjs as it does in normal DQL, but DQL does have less words.
Are you sure about that?
The where works the same in datviewjs as it does in normal DQL, but DQL does have less words.
Are you sure about that?
If you need an example....
Table without ID
file.link, file.frontmatter.mathLink
From "Glossary"
Where contains(fileClass, "Dimensions")
const rows = dv.pages('"Glossary"').where(p => p.fileClass == 'Dimensions').map(p => [
p.file.link,
p.file.frontmatter.mathLink]);
dv.table(["Link", "mathLink"], rows);
Table without ID
file.link, file.frontmatter.mathLink
From "Glossary"
Where !contains(fileClass, "Dimensions")
Limit 10
const rows = dv.pages('"Glossary"').where(p => p.fileClass !== 'Dimensions').map(p => [
p.file.link,
p.file.frontmatter.mathLink]).limit(10);
dv.table(["Link", "mathLink"], rows);
Is your Feature Request Related to a Problem?
No response
Describe the Feature you'd Like
Currently optionQuery() only takes data sources input to limit the alternatives, but I need/want to specify notes more specifically, and would like to be able to restrict the options on frontmatter/property data as well.
Additional Context
No response