We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8811ac commit 31cd181Copy full SHA for 31cd181
infra/dataform-export/firestore.js
@@ -83,23 +83,22 @@ export class FirestoreBatch {
83
}
84
85
while (true) {
86
- const snapshot = await collectionQuery.limit(100000).get()
+ const snapshot = await collectionQuery.limit(this.batchSize * this.maxConcurrentBatches).get()
87
if (snapshot.empty) {
88
break
89
90
91
- snapshot.forEach(async (doc) => {
+ for await (const doc of snapshot.docs) {
92
this.currentBatch.push(doc)
93
94
if (this.currentBatch.length >= this.batchSize) {
95
this.queueBatch('delete')
96
97
-
98
if (this.batchPromises.length >= this.maxConcurrentBatches) {
99
await this.commitBatches()
100
101
totalDocsDeleted++
102
- })
+ }
103
104
await this.finalFlush('delete')
105
0 commit comments