Fork me on GitHub
Brandon Olivier22:02:04

Is there a way to order-by transaction time?


You can use the entity-history function (and write a helper function to assoc tx/valid time into the entity for sorting) but there's no way (yet) to get that information just from a query


You can however embed those entity-history functions inside a query (which is reasonably efficient) see (and then apply a Datalog order-by - which in turn may not be that efficient, depending on the size of the result set)

Brandon Olivier22:02:14

Or would I need to add a new field to my document for that?


This is generally the better option if you require access to the data for fast & flexible querying (in the current version of XT, at least 🙂)

👍 1