I'm trying to access all documents from my firestore collection
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
async function getTodos() {
try {
const todoRef = collection(db, 'todos');
let allTodos = await getDoc(todoRef);
console.log(allTodos)
} catch (err) {
console.log(err)
}
}
but it's throwing this err
FirebaseError: Expected type 'Tc', but it was: a custom Ac object