How to list block ids and block uuids?

I want to get a table of block ids and their UUIDs.

I used the receipts page by @Siferiax from here: https://siferiax.github.io/#/page/logseq%2Fadvanced%20queries

My query looks like this:

#+BEGIN_QUERY
{
  :title "Block and their UUIDs"
  :query [
    :find ?b ?u
    :keys c1 c2
    :where
      [?b :block/uuid ?u]
  ]
  :view (fn [rows] [
    :table [
      :thead [
        :tr
          [:th "block"]
          [:th "uuid"]
      ]
    ] [
      :tbody (for [r rows] [
        :tr
          [:td (get-in r [:c1])]
          [:td (get-in r [:c2])]
      ])
    ]
  ])
}
#+END_QUERY

For some reason it results to a render error:

image

What I do wrong folks?

  • Like in the other case, :block/uuid is not a proper string.
  • Wrap it inside (str), i.e.: (str (get-in r [:c2]))
1 Like