Sort advance query by block property

Hi All,

I have a query to retrieve the birthday for the current month.

   [:h4 "📅 " [:code "This Month's B-Day"]] 
  :query [:find (pull ?b [*])
    :in $ ?today
      [?b :block/properties ?prop]
      [(get ?prop :birthday) ?birth]
      [?j :block/journal-day ?birthint]
      [?j :block/original-name ?jname]
      [(contains? ?birth ?jname)]
      [(str ?birthint) ?birthstr]
      [(subs ?birthstr 4 6) ?birthm]
      [(subs ?birthstr 6 8) ?birthd]
      [(str ?today) ?td]
      [(subs ?td 4 6) ?todaym]
      [(subs ?td 6 8) ?todayd]
      [(= ?birthm ?todaym)]
      [(< ?todayd "05")]
      [?b :block/page ?p]
:inputs [:today]
:result-transform (fn [result]
                (sort-by (fn [d]
                           (get d :block/birthday)) result))
:collapsed? true}

I would like to sort the results by birthday and keep the ‘group-by-page?’ true.
Any idea?


I would like to

If only… that would be so nice!
It’s currently not possible unfortunately :frowning:

For the sort itself should be:
(get-in d [:block/properties :birthday])

1 Like

It is a pity. Let’s wait for the new DB version…maybe…
Thanks as usual!!!