How can I update more than 500 docs in Firestore using Batch?

后端 未结 3 1778
说谎
说谎 2020-12-03 05:56

I\'m trying to update a field timestamp with the Firestore admin timestamp in a collection with more than 500 docs.

const batch = d         


        
3条回答
  •  心在旅途
    2020-12-03 06:42

    Your solution will not really be "recursive". If you want to batch update a collection with more than 500 documents, you will have to iterate the documents, create batches of 500 or less on your own, then commit the batches individually. Or, you can simply update each document individually, as there might not be any real need for batches in your situation.

提交回复
热议问题