Open ontrou opened 1 year ago
@ontrou sure!
Dataview allows to access note's metadata as a property.
For example, to get all pages where 'type' metadata property equals 'observation', use this query:
dv.pages().where(p => p.type === 'observation
)`.
This should work!
@dartungar I am so glad to hear this!. But I got this parsing error with this query: dv.pages().where(p => p.sub === '[[Resource]]')
I reinstalled the plugin, tried different metadata, and got the same error:
`plugin:simple-note-review:173 Simple Note Review - dataview API error: Failed to parse query in 'pagePaths': Error: -- PARSING FAILED --------------------------------------------------
1 | dv.pages().where(p => p.sub === "[[Resource]]") | ^
Expected one of the following:
'!', '(', '-', 'csv(', 'outgoing(', file link, string, tag ('#hello/stuff')
eval @ plugin:simple-note-review:173 plugin:simple-note-review:573 Error while trying to get next note in noteset "dv.pages().where(p => p.sub === "[[Resource]]")" via Dataview API. Please check noteset settings and/or disabling and enabling Simple Note Review plugin again. eval @ plugin:simple-note-review:573`
@ontrou this may be some internal plugin error, as dataview syntax seems to be correct. will look into it hopefully soon.
@ontrou new 1.2.0 version should help with Dataview validation. Please report if you still see any errors!
Thank you for keeping this issue on your radar. I stopped using Simple Note Revew because of this issue, but re-installed it (v1.2.1) when I saw this post. I still can't get the DataviewJS query to work. The message is: notset review queue is empty. I refreshed, reinstalled, restarted… still no go. Really like your approach to doing a note review. Will definitely keep your plugin on my radar too.
@ontrou does this dataviewJS query match notes if used without SNR? Could you provide the full query?
Yes, the dataviewJS query outside of SNR does match notes. My query is: dv.pages().where(p => p.fileClass === 'Source')
@ontrou I see what might be the problem here. SNR accepts only what you'd put into dv.pages()
as an argument, e.g what you'd put into FROM clause, but not what you'd put into WHERE clause.
This is because there's no way to execute full dataviewJS code and get the results as list of note paths, at least none that I know of.
Any help with that would be appreciated.
@dartungar Oh, I see. I vaguely wondered if that was the issue. My problem is that I don't use folders or tags, but I do use a other metadata. Thanks for explaining. I'll think on it and get back to you.
I don't use tags or folders in my vault (call me crazy), but I use plenty of other metadata. It's not clear to me how to structure the DataviewJS query to create a note set using metadata that is not tags or folders. Is it possible? Can you give an example? Thank you so much for your plugin. It fills a crucial niche.