Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- :title "🔨 All todos with current pages tag"
- ;; Fetch all TODO/DOING blocks using simple query
- :query (todo TODO DOING)
- ;; Check for journal-day
- :where
- [?b :block/ref-pages ?p]
- [?p :block/journal? true]
- [?p :block/journal-day ?d]
- ;; Use Transform to fetch the parent page of a block (journal page) and then sort on journal-day of that page
- :result-transform
- (fn [result]
- (sort-by (fn [h](get (get h :block/page) :block/journal-day)) result)
- )
- ;; Stuff I use to get debug data
- ;;:view (fn [result]
- ;; (when (seq result)
- ;; (let [blocks (flatten result)] [:p (pprint result)])
- ;; )
- ;;)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement