I need to access a single field in a firebase document without downloading the entire doc.
Usecase: I have a comments page and a comments collection in firebase. I need to know how many comments are in there without downloading them all. There is a doc with a field commentCount, which is updated every time a new comment is posted, and an array of all comments. I want to access the field commentCount and read its value.
this.angularFireStore.firestore.collection('comments/' + id + '/commentCount').get().then(col => {
console.log(col);
});
I have tried this, but it returns an undefinded. How can i achieve this?