biff

jf 2024-09-21T10:30:13.387769Z

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

2024-09-21T16:37:10.105519Z

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
jf 2024-09-22T16:28:26.070379Z

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