Reputation: 79
I am trying to query a single document. Here is my current code. Been on this for hours and can't seem to get it to work. Bet its an easy fix
export function GetSingleTicket() {
const docRef = doc(db, "tickets", "hg7G40Lhwh9HVwqe4mlB");
getDoc(docRef).then((doc) => {
console.log(doc.data(), doc.id);
});
}
Upvotes: 0
Views: 51
Reputation: 1702
As mentioned by @Frank van Puffelen Property names are case-sensitive. And according to your code the collection name is in small letters.
Solution:
export function GetSingleTicket() {
const docRef = doc(db, "Tickets", "hg7G40Lhwh9HVwqe4mlB");
getDoc(docRef).then((doc) => {
console.log(doc.data(), doc.id);
});
}
Upvotes: 1