I'm trying to "move" a document from one collection to another in Firestore. That means copy/paste a document and then delete the original. I'm trying to achieve this server-side using Python.
I'm aware that using transactions might do the trick, but I'm wondering why couldn't I just use a basic : .get() .set() and .delete() in order to do that? Because of another thread coming from another machine and modifying the document when I'm moving it ? Very unlikely in my case.
And then another question : why transaction and not a batch ? Since I'm copy/pasting the document, does that means that I'm reading it ?
Last point : do someone have a better example than the example from the docs ?
question from:https://stackoverflow.com/questions/65945300/how-to-move-a-document-between-2-collections-in-firebase