I'm trying to perform a filter and sort query, but I want to put it inside a function. How can I do that ?
I'm trying to do this
const handleFilter = () => {
const q = query(collection(db, "location"), where ("location", "==", "Pasig"));
const querySnapshot = await getDocs(q);
querySnapshot.forEach((doc) => {
(doc.id, " => ", doc.data());
});
}
But it is not working.