How to simplify dataviewjs query which has to query notes within same folder but not the one with dataviewjs itself? #469
-
Simplified file structure to illustrate what I struggle with in every dataviewjs query I have: and now const pages = dv
.pages('"_tmp/something/one more"')
.filter(page => page.file.name !== "one more");
dv.table(["file"], pages.map(page => [page.file.link])); What bugs me is:
|
Beta Was this translation helpful? Give feedback.
Answered by
blacksmithgu
Sep 7, 2021
Replies: 1 comment 1 reply
-
You can access current file metadata via const pages = dv
.pages(`'${dv.current().file.folder}'`)
.filter(page => page.file.name !== dv.current().file.name);
dv.table(["file"], pages.map(page => [page.file.link])); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nkoder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can access current file metadata via
dv.current()
. You can access the file name viadv.current().file.name
, and the current (immediate parent) folder viadv.current().file.folder
. Your query could then look something like this, generically: