---
title: "Comment by Maciej Węgrzynek on \"How to copy, delete, or move a document in Firestore\" | Hashnode"
description: "For &quot;Copy&quot; script, shouldn&#39;t there be // get all the documents in the collection await subcollectionRef instead of // get all the documents in the"
url: "https://hashnode.com/posts/firestore-move/5fb19e0b03f7294d0e3a8ab9/comment/620ced7625673f2740eea0df"
---

[Discussion](https://hashnode.com/posts/firestore-move/5fb19e0b03f7294d0e3a8ab9)

Comment [How to copy, delete, or move a document in Firestore](https://hashnode.com/posts/firestore-move/5fb19e0b03f7294d0e3a8ab9)

[Maciej Węgrzynek](https://hashnode.com/@MaciejW)

[Feb 16, 2022](https://hashnode.com/posts/firestore-move/5fb19e0b03f7294d0e3a8ab9/comment/620ced7625673f2740eea0df)

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.
