I am trying to get all the document id from the (message) table but it returns undefined. However, when i try it with my another table (donor), it is working.
I am wondering, in the message table, is it because the documents refers to a collection, instead of some fields, that's why it becomes undefined?
Anyways, my question is, how to get all the document id from my message table? My approach for the message returns undefined.
db.collection('messages')
.get()
.then((querySnapshot) => {
querySnapshot.forEach((doc) => console.log(doc.data()));
});
db.collection('donor')
.get()
.then((querySnapshot) => {
querySnapshot.forEach((doc) => console.log(doc.data()));
});