Sign in
Log inSign up
Andrey Lechev

28 likes

·

12.5K reads

4 comments

Thomas Götzsche
Thomas Götzsche
Jul 30, 2021

shouldn't at least the moveDoc function wrap the operations in a transaction?

·
·1 reply
Andrey Lechev
Andrey Lechev
Author
·Jul 31, 2021

Seems strange that you are going to delete document that can be changed during the operation.

But even in that case the read operation is done once and the newly created document will have the content at this moment. No transaction needed.

And if youare expecting the write operation in the result document... all of the content will be overwritten.

Generally, make sure, that you are not working with actively used documents. Otherwise a whole bunch of errors can happen: loss of data, update of non-existing documents and so on. Or... change the functions to handle all the cases: only copy, but not move and create the new doc at least with merge option, but better check if the doc exists and merge the data with some custom logic.

·
Sam Smith
Sam Smith
Dec 13, 2021

You should include your thesis statement into your introduction paragraph. It should unite all your arguments https://educibly.com/ . Here are some main tips that will help you deal with such specific paper as 5 paragraph essay.

·
Maciej Węgrzynek
Maciej Węgrzynek
Feb 16, 2022

For "Copy" script, shouldn't there be

// get all the documents in the collection
await subcollectionRef

instead of

// get all the documents in the collection
 return await subcollectionRef

when copying recursively?

Return value in for..of means that iterator will finish. So only the first subcollection will be copied. Or maybe I'm missing something.

·