Skip to content Skip to sidebar Skip to footer

Which Are The Recomended Arguments To Use When Deleting A Collection Within A Cloud Firestore Database?

I'm using the following method to delete a Cloud Firestore collection as explained here. deleteCollection( final CollectionReference collection, final int batchSize, Ex

Solution 1:

The sample code you see there for Android comes directly from this code in GitHub. Digging around in there, you can see that the sample coded uses the following Executor:

privatestaticfinalThreadPoolExecutorEXECUTOR=newThreadPoolExecutor(2, 4,
    60, TimeUnit.SECONDS, newLinkedBlockingQueue<Runnable>());

Whether or not that's the best possible case for your particular situation, that's not really possible to say.

Regarding the batch size, the documentation also suggests that you need to make a judgement call:

If you have larger collections, you may want to delete the documents in smaller batches to avoid out-of-memory errors.

Given that we don't really know your specific situation, it's not really possible to give an answer that definitively gives you a best-possible solution.

Post a Comment for "Which Are The Recomended Arguments To Use When Deleting A Collection Within A Cloud Firestore Database?"