Skip to content
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

[Feature Request] Support for batched operations #18

Open
raghavsatyadev opened this issue Aug 3, 2019 · 3 comments
Open

[Feature Request] Support for batched operations #18

raghavsatyadev opened this issue Aug 3, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request Hacktoberfest

Comments

@raghavsatyadev
Copy link

Firestore supports batched operations, this library would be really good if you can support this. a batch can support 500 operation max, here's the URL for batched operations

https://firebase.google.com/docs/firestore/manage-data/transactions#batched-writes

// Get a new write batch
let batch = db.batch();

// Set the value of 'NYC'
let nycRef = db.collection('cities').doc('NYC');
batch.set(nycRef, {name: 'New York City'});

// Update the population of 'SF'
let sfRef = db.collection('cities').doc('SF');
batch.update(sfRef, {population: 1000000});

// Delete the city 'LA'
let laRef = db.collection('cities').doc('LA');
batch.delete(laRef);

// Commit the batch
return batch.commit().then(function () {
  // ...
});
@dalenguyen dalenguyen self-assigned this Aug 17, 2019
@dalenguyen dalenguyen added enhancement New feature or request Hacktoberfest labels Sep 26, 2019
@raghavsatyadev
Copy link
Author

Hello, any update on this?

@dalenguyen
Copy link
Owner

Hi @raghavsatyadev, not yet. There is a step in between to update subcollection. I haven't had time to take a deep look into this. Is this something that prevents your app from working?

@raghavsatyadev
Copy link
Author

No actually it does not stop it. But this can speed up the process so much. Minimum a 100 times speed. I have used batch process in my native Android app and I can tell it can help in this library too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants