Awesome, awesome, awesome!
I’m almost there. I’ve got the sort working in reverse order, but my take 1 isn’t having any effect. I’m not sure if the take one needs to be appended to a different transform, or if I’m in the wrong order, or what. Here’s how my query stands now:
{
:title [ :h3 "💡 Previous One on One meeting with Sarah Langville" ]
:query [:find (pull ?b [*])
:in $ ?start ?today ?tag ?tag2
:where
;; filter by Journal Day
[?b :block/page ?p]
[?p :page/journal-day ?d]
[(>= ?d ?start)]
[(< ?d ?today)]
;; search for Tag and Tag2
[?b :block/path-refs ?ref] [?ref :block/name ?tag]
[?b :block/path-refs ?ref2] [?ref2 :block/name ?tag2]
]
;; reverse sort by day, take the first result
:result-transform (fn [result]
(take 1
(reverse
(sort-by (fn [h] (get h [:block/page :block/journal-day])))
)
)
)
:inputs [:-60d :today "[[Sarah Langville]]" "[[One on One]]"]
}
Would appreciate any insight into what I’m doing wrong here!