I'm trying to connect Firestore (v 9.6.7) to my app. I'm using web 9 syntax. My code is almost directly from the guides here.
It looks like:
import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
import { collection, getDocs } from "firebase/firestore";
// Initialize Firebase
const firebaseConfig = {
apiKey: ...
authDomain: ...,
projectId: ...,
storageBucket: ...,
messagingSenderId:...,
appId: ...,
measurementId: ...
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
// Read collection from Firestore and print it
const querySnapshot = getDocs(collection(db, "Users"));
console.log(querySnapshot);
export {
db
}
The promise returned is:
Promise { "_U": 0, "_V": 0, "_W": null, "_X": null, }
What's going wrong?
Thanks.