Getting the id of an inserted entity in datomic?

前端 未结 4 1855
臣服心动
臣服心动 2021-02-19 20:43

After I run a transaction in datomic to insert a value, how I can use the return value of the transaction to get the ids of any entities that were created?

Here is a sam

4条回答
  •  北恋
    北恋 (楼主)
    2021-02-19 21:17

    Ah, figured it out.

    I had to deref the Clojure promise, and then I was able to yank out the values I wanted:

     (:e (second (:tx-data @(transact! conn query))))
    

提交回复
热议问题