Skip to content

Instantly share code, notes, and snippets.

@yonatane
Created March 27, 2021 21:33
Show Gist options
  • Save yonatane/2f85aa076f3cca54e8c831cb0f45ca32 to your computer and use it in GitHub Desktop.
Save yonatane/2f85aa076f3cca54e8c831cb0f45ca32 to your computer and use it in GitHub Desktop.
Logseq query example: all TODOs that are tagged or has an ancestor (including page) that is tagged with #clojure
#+BEGIN_QUERY
{:query
[:find (pull ?b [*])
:where
[?b :block/marker "TODO"]
[?b :block/page ?p]
(or [?b :block/path-ref-pages [:page/name "clojure"]]
[?p :page/tags [:page/name "clojure"]]
[?p :page/name "clojure"])
]}
#+END_QUERY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment