Using Firebase Firestore, I have a data structure that looks like this:
rooms{
room1 {
datum : string
people {
person1 {
name : string
aliases {
x : string
A root collection, rooms
A child doc, room1
A grand-child collection, people,
A grand-child doc, person1
A great-grandchild collection, aliases
I'm using Angular and Firebase for my app. I'm trying to update the grandchild collection, aliases. The first step I'm taking is to access that collection; this is what I've tried so far:
people = this.firestore
.collection("rooms")
.doc("room1")
.collection("people").snapshotChanges();
people.subscribe(item =>{
console.log(item)
})
The issue is, nothing is ever returned. I know it's not due to waiting for the subscription because I put the subscribe / console.log component in a button, put the snapshot changes component in ngOnInit, and still got nothing regardless of how long I waited.
Technically, the 'people' collection is an array inside the room1 doc, not necessarily a sub-collection. How do I properly access grandchild data structures with firebase?