I am trying to get a post title from firestore but somehow I could not figure out how that could be done using async await.
async getVideo(id) {
var self = this;
const ref = this.$fire.firestore
.collection("posts")
.where("ytid", "==", id)
.orderBy("createdAt", "desc");
try {
let post = await ref.get();
console.log(post.data());
} catch (e) {
console.log(e);
}
}
I tried to console log post.data() but it says post.data() is not a function. Any help would be appreciated.