Hey I am trying to get all documents of a certain collection in firebase using:
const userCollectionRef = collection(db, currentUser?.uid)
const snapshot = await userCollectionRef.get()
for (const doc of snapshot) {
console.log(doc.id)
}
The problem:
TypeError: userCollectionRef.get is not a function
My imports:
import { db } from '../firebase'
import { collection } from 'firebase/firestore'