-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
firestore.recursiveDelete()
doesn't work on collections with over 1000 documents
#2292
Comments
firestore.recursiveDelete()
doesn't work on collections with over 5000 documentsfirestore.recursiveDelete()
doesn't work on collections with over 1000 documents
Hi @mohatt , thank you for reporting this issue. could you please try:
|
Hi @milaGGL, I tried the steps you mentioned:
Potential CauseAfter reviewing the source code, I believe the issue lies in the following condition in this line inside recursive-delete.ts: if (streamedDocsCount < this.minPendingOps) {
this.onQueryEnd(); This condition is incorrect because query = query.select(FieldPath.documentId()).limit(this.maxPendingOps); Since if (streamedDocsCount < this.maxPendingOps) { I believe this mismatch is causing the function to hang indefinitely when processing collections over Let me know if you need any more details! Thanks. |
@mohatt, I have tried the following test and it worked as expected:
Would you be able to provide a minimal reproduction app? |
Hey @milaGGL, your test case works fine, but after testing in multiple ways, I think that the issue only occurs when running in the local Firestore Emulator and only under certain conditions. My use case is a bit more complex—it involves running I was able to fix the issue by modifying the condition from |
yes, a minimal repro app is appreciated. Thank you @mohatt. |
Is this a client library issue or a product issue?
This is the client library for Firestore.
Did someone already solve this?
No
Environment details
@google-cloud/firestore
version: 7.11.0Steps to reproduce
firestore.recursiveDelete()
on the collection referenceThe text was updated successfully, but these errors were encountered: