baiwj
1
hi,
i tried following code trying to query all untagged block in journal page, but fails…
#+BEGIN_QUERY
{:title [:h3 “query all untagged block in journal page”]
:query [:find (pull ?b [*])
:where
[?p :block/name _]
[?p :page/journal? true]
[?b :block/page ?p]
(not [(clojure.string/includes? ?b “#”)])
]}
#+END_QUERY
thank you for any hints
baiwj
3
@mentaloid thank you very much, accordingly i update the code as follows:
#+BEGIN_QUERY
{:title [:h3 "random 3 untagged blocks from joural pages"]
:query [:find (pull ?b [*])
:where
[?p :block/name _]
[?p :page/journal? true]
[?b :block/page ?p]
[?b :block/content ?c]
(not [(clojure.string/includes? ?c "#" )])
(not [(clojure.string/includes? ?c "[[" )])
]
:result-transform (fn [result] (take 3 (shuffle result)))
:breadcrumb-show? true
:collapsed? true
}
#+END_QUERY
the code will resurface 3 untagged blocks from journal pages, basically it works for me so far so good
1 Like