dshukertjr
dshukertjr

Reputation: 18593

What is the bulk write limit of Firestore admin SDK

I am trying to implement a bulk import functionality for a web app that I am working on, and was wondering if there is a limit to how many "add's" that can be performed by a cloud function for firebase using admin SDK.

To be specific, I was wondering if firebase cloud function and the admin SDK is capable of doing something like this:

for(var i = 0; i < 20000; i++) {
    admin.firestore().collection("someLocation").add({
        time: admin.firestore.FieldValue.serverTimestamp()
    })
}

When I did similar thing with realtime database from the client, the data was entered only until like the first 100 entries.

Is this bulk upload type of thing possible?

Upvotes: 1

Views: 2814

Answers (1)

Hiranya Jayathilaka
Hiranya Jayathilaka

Reputation: 7438

You can use Firestore batch writes, that allow up to 500 updates in the same operation. Other than that you're also limited by Firestore quotas. That is 2500 writes per second, and 20000 writes a day (for free tier).

Upvotes: 3

Related Questions