Fork me on GitHub
#xtdb
<
2021-08-27
>
plins21:08:09

Im trying to fetch the last 2 created entities ordering it by date of creation (its in the entity payload) with

(crux/q (crux/db db)     '{:find  [(pull ?sync [*])]
                          :where [[?sync ::entity/name name]
                                  [?sync ::entity/created-at created-at]]
                          :limit 2
                          :order-by [[created-at :desc]]
                          :in    [name]}
                         "some-name")
the database record would look like
{:my-ns.entity/name "John"
 :crux.db/id "who cares" 
 :my-ns.entity/created-at #inst "..."} 

plins21:08:45

If I take the order-by off the query works