Skip to content

[Bug]: list_of_documents does not fetch all collection entries #12

Open
@flashsturz

Description

@flashsturz

Is there an existing issue for this?

  • I have searched the existing issues

Environment

-   OS: Win11
-   Python: 3.9.16

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

# I used the following command to fetch all documents of a large collection:

active_ids = fsdb.collection("active_files").list_of_documents(self.user["idToken"])
#Returns only a subset of all documents in "active_files", accessible through the firestore console.

Relevant log output

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions