0

With a structure like this:

.doc Name
   .colection 1
       .doc sub_doc
           .colection sub_col1
              .doc sub_doc
   .colection 2
       .doc sub_doc

How can I clone the document(with all of the sub collections etc) in to a new document in Firestore? Basicly creating a 1:1 copy of the document.

Is this a matter of querying the entire document first and rebuilding it from there?

Thanks in advance.

jACK
  • 142
  • 1
  • 13

1 Answers1

1

There is no built-in operation to clone a document or collection. You will have to read the document/collection through the API and write the copy through that too.

Also see:

Frank van Puffelen
  • 499,950
  • 69
  • 739
  • 734