My goal is to retrieve a post title from Firestore, but I'm having trouble figuring out how to do so 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);
}
}
When I attempted to log post.data(), it returned an error stating that post.data() is not a function. Any assistance on this matter would be greatly appreciated.