Firestore sub-collections with nonexistent parents are not showing in emulator
See original GitHub issue[REQUIRED] Environment info
firebase-tools: 8.4.0
Platform: macOS 10.15.4
[REQUIRED] Test case
I’ve found that when having nested collections in Firestore, they don’t display on the web interface of the emulator unless parent documents contain data.
[REQUIRED] Steps to reproduce
// create some data in a nested collection without data in the document
db.collection('stripe')
.doc('6tSfMgrOCEOi3kj0IHRivd0ZCgX2')
.collection('subscriptions')
.doc('sub_123456789').set({
status: "active"
})
[REQUIRED] Expected behavior
On the production version of the data viewer, it displays empty documents in italics (to designate that there is no fields but sub-collections exist). Image below.
[REQUIRED] Actual behavior
There is nothing to display on the UI and I cannot access child collections. If I set some dummy data on a document, the row will appear.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:32
- Comments:14 (4 by maintainers)
Top Results From Across the Web
This document does not exist and will not appear in queries or ...
In Cloud Firestore it is possible to have subcollections owned by "virtual" documents - that is the document at the higher level doesn't...
Read more >Cloud Firestore Data model - Firebase
Collections and documents are created implicitly in Cloud Firestore. Simply assign data to a document within a collection. If either the collection or...
Read more >Create a Firestore subcollection reference - Google Cloud
Create a Firestore subcollection reference. bookmark_border. Stay organized with collections Save and categorize content based on your preferences. Dismiss
Read more >How to read your entire dataset in Firestore - Medium
We can see my two root-collections: chatrooms and users. It shows the three chatrooms documents, even through chatrooms/flash does not exist ( ...
Read more >Getting Started With Cloud Firestore for Android - Code
A subcollection is just a collection that belongs to a document. By default, a document automatically becomes the parent of all the documents ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve escalated this internally as b/152785133 and we’re actively trying to staff this fix. In the meantime, feel free to send us a Pull Request.
This is not merely an emulator UI issue.
In certain cases, the behavior of writes is different between emulators and production.
Steps to reproduce:
Perform the following write operation, on em empty database.
Expected behavior
Actual behavior: