-
Notifications
You must be signed in to change notification settings - Fork 900
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
simultaneous fetching of many documents from firestore #191
Comments
I made a test: It does not happen all the time, but please try to reload few times and you will see, that second (or maybe other) test will take very long time to finish, in my case usually it looks like this: Looking at the debug logs, you see the delay between following logs:
|
The issue is now fixed. |
Is there a limit to how many queries you can fire off? What if I wanted to loop through and combineLatest 2000 times? |
Describe your environment
Describe the problem
I think that there is a serious issue with firebase-js-sdk of with firestore itself. In my I app I need to fetch data of multiple documents from different collections. Assume we have following structure: collection "customers", contains documents "customer" with subcollection "products" of "product" documents
Now, let say that I have list of customerId&productId pairs, which need to be fetched. I do loop over the list and for each pair I execute following:
firestore.doc("/customers/" + customerId + "/products/" + productId).get().then(data => console.log(data));
Now, if the list of documents is small the data are fetched in reasonable time, but when there are more than 20 documents to be fetched the data for all documents are delayed and it takes 30-60 seconds (depends how many documents to be fetched).
In real scenario I'm not using .get in a loop, but instead I use AngularFire2 and Observable.combineLatest - but the results are the same: when simultaneously fetching many documents, it causes huge delays of getting the data.
The same thing but using admin-node-sdk worked without any issues.
Steps to reproduce:
Call .doc 50 times in a row, e.g.:
The text was updated successfully, but these errors were encountered: