Which are the recomended arguments to use when deleting a Collection within a Cloud Firestore database?

后端 未结 1 1955
被撕碎了的回忆
被撕碎了的回忆 2021-01-28 08:13

I\'m using the following method to delete a Cloud Firestore collection as explained here.

deleteCollection(
    final CollectionReference collection,
    final i         


        
相关标签:
1条回答
  • 2021-01-28 09:11

    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:

    private static final ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(2, 4,
        60, TimeUnit.SECONDS, new LinkedBlockingQueue<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.

    0 讨论(0)
提交回复
热议问题