skip to Main Content

Say I have the following structure:
collectionA/documentA/collectionB/documentB
But I have set documentB directly to the above path (without explicitly creating collectionA, documentA or collectionB), so the document "documentA" is a non existent document that does not show in queries if I list all documents of collectionA even with admin sdk.
However the firebase web console somehow manages to list such documents. Not only that, I have also seen a third party app Firefoo list such documents and somehow even paginate the results. How can I achieve this?

2

Answers


  1. Chosen as BEST ANSWER

    Turns out this can be achieved with the Firestore REST API v1 using the listDocuments endpoint and setting query param showMissing to true.


  2. All Firestore queries are based on having some data about that document present in the index that is used for the query. There is no public API to show non-existing documents.

    The Firebase console shows these documents based on getting a list of all collections, and then building a data model from that.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search