biff 2024-09-21

Is there a way to insert a new document in xtdb and then have the id be returned in the same call?

yeah, you can pass the ID in to biff/submit-tx instead of letting it generate one for you:

(let [id (random-uuid)]
  (biff/submit-tx ctx [{:xt/id id ...}])
  id)

1

thank you! I was hoping (dreaming?) for the db to just magically return that id; but I guess I need to shed more of my RDBMS thinking. Given xtdb's architecture this just doesnt make sense. And practically, if I know that the id is going to be a uuid anyway, I could generate and specify it myself. Thank you!

👌 1