Result-transform function to show n random items?

Hi, I’m currentñy using rand-nth function to show one random task, but I think it would be usefull to show like 5 tasks to let me decide instead of refresing page 5 times. It’s that possible? I’m pretty novel on datascript.
Thank you in advance!

  • rand-nth is not datascript, but clojure
  • Try :result-transform (fn [result] (take 5 (shuffle result)))

that worked very well, thank you very much!

Now that I’m talking with someone that knows a bit about this, and since I have no shame :grin:, I will ask you what’s the difference to logseq between what you posted:

:result-transform (fn [result]
                      (take 5 (shuffle result)

And that thing that produces a text output with a, lazy sequence? of blocks properties.

:result-transform (fn [result]
                      [(take 5 (shuffle result)]

This is just an extra question, If I’m taking advantage, please don’t answer. Thank you again.

Different types of collections are treated and rendered differently. Check Clojure Data Structures Tutorial