1.查询所有无scheduled(或deadline)的Todo:
这个需求似乎困扰了大家很久,前两天天生在群里也提到了用get-else的方法实现,我后来便去查询了get-else的方法,无意中看到了有外国朋友推荐的missing? 似乎也能实现,并且理解起来比较简单,就试了试,没想到还真能用
#+BEGIN_QUERY
{:title "无scheduled的TODO"
:query [:find (pull ?b [*])
:where
[?b :block/marker ?marker3]
[(contains? #{"NOW" "LATER" "DOING" "TODO"} ?marker3)]
[(missing? $ ?b :block/scheduled )]]
:collapsed? false}
#+END_QUERY
scheduled可替换成deadline。
2.查询所有已scheduled(或deadline)的Todo(前段时间倒腾出来的):
#+BEGIN_QUERY
{:title " 已scheduled"
:query [:find (pull ?b [*])
:where
[?b :block/scheduled ?d]
[?b :block/marker ?marker2]
[(not= ?d nil)]
[(contains? #{"NOW" "LATER" "DOING" "TODO"} ?marker2)]]
:collapsed? false}
#+END_QUERY
3.查询scheduled(或deadline)在某段指定日期内的Todo(也是之前写的,便于进行周todo、月todo查询):
#+BEGIN_QUERY
{:title ":date: scheduled在二月的"
:query [:find (pull ?b [*])
:where
[?b :block/scheduled ?d]
[?b :block/marker ?marker]
[(>= ?d "20210201")]
[(<= ?d "20210228")]
[(contains? #{"NOW" "LATER" "DOING" "TODO"} ?marker)]]
:collapsed? false}
#+END_QUERY
以后再倒腾出新的query会继续往这发 ~