This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-06
Channels
- # announcements (3)
- # beginners (8)
- # calva (17)
- # cider (3)
- # clj-kondo (1)
- # cljs-dev (7)
- # clojure (11)
- # clojure-dev (9)
- # clojure-europe (1)
- # clojuredesign-podcast (4)
- # clojurescript (10)
- # conjure (13)
- # datomic (3)
- # emacs (3)
- # figwheel-main (1)
- # fulcro (12)
- # leiningen (8)
- # meander (20)
- # off-topic (85)
- # pathom (1)
- # shadow-cljs (39)
- # spacemacs (7)
- # tools-deps (44)
- # xtdb (5)
Hello! What would be the way to order the results of a find
query according the the valid time or even the transaction time? From the docs I understand the :order-by
key takes a field from the submitted document?
Hey! Assuming you are pulling entity IDs out of the find
then you would need to map over the tuples to lookup the relevant tt/vt time for each using entity-history
and then sort on those values as a final step. We are looking at exposing the various times directly into query execution (as this kind of thing isn't an uncommon request!) but unfortunately it's not something we will be delivering in the short-term.
I would be really interested to hear more about the use-case though as it may help guide us towards the eventual solution. For instance, are you thinking about displaying sorted data grids to users that include audit times?
Hey @U899JBRPF thanks for the info. Yes I'm looking for a pull of various docs which have a particular value for a key and these need to be ordered in the ttime. they got transacted. The use case is that I'm using Crux for a CI/CD system I've been building and this is for the clients to pull the logs of a build given a run-id. Each log is a doc with a unique id and it contains the log line. Since log lines need a temporal ordering, I wanted to exploit the time aspects of crux and was hoping that I dont need a time field in the log document and can order it during the pull. Hope I'm thinking right? Any more pointers are most welcome and happy to share more details 😄