-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Bug]: list_of_documents does not fetch all collection entries #12
Comments
@flashsturz |
I use a user-based account and can confirm that it uses the API endpoint to get the documents. Sorry about the confusion. |
@flashsturz
Were you able to find out this default value use in the official library? I wonder if it's a constant number, or it changes based on something, which an AI might determine. |
Unfortunately, I do not know how the default value is chosen, since the documentation of the firestore library is not exactly stating how it is set:
(From |
Sorry to get back at it this late, but from what I checked, The REST API for firestore doesn't return all documents at once, it returns a next page token, using which further ones need to be retrieved. Now it would mean the library will have to make multiple requests before providing a result of all documents. And in case of large number of documents, it might take a long time. I could enable passing of page_size argument, so for cases where the no of docs is supposed to be large, the dev can a larger page size. I'll set the default page size to 20, as tradition. Does it seem fine? @flashsturz |
Sorry for the delayed response from my side. Yes, I think it might be good to give the user the ability to set the page_size argument. |
Is there an existing issue for this?
Environment
What happened?
When using the command list_of_documents() to get all entries from a collection, it seems that only a subset of the whole collection is returned.
This is further confirmed when having a look at collection.py in the google_cloud_firestore library in method list_documents(). The function list_documents takes as argument an optional "page_size", which determines how many documents will be displayed/returned. This is set per default by the API, but it is not certain that this command returns all available documents in the collection (e.g. if you have several hundred documents.)
I currently do not know how to work around this issue. Any ideas?
Code Snippet
Relevant log output
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: