Skip to content
Felicia Ann Kelley edited this page Oct 13, 2023 · 1 revision

1. Welcome to the Status- wiki! import { initializeApp } from 'firebase/app'; import { getFirestore, collection, getDocs } from 'firebase/firestore/lite'; // Follow this pattern to import other Firebase services // import { } from 'firebase/';

// TODO: Replace the following with your app's Firebase project configuration const firebaseConfig = { //... };

const app = initializeApp(firebaseConfig); const db = getFirestore(app);

// Get a list of cities from your database async function getCities(db) { const citiesCol = collection(db, 'cities'); const citySnapshot = await getDocs(citiesCol); const cityList = citySnapshot.docs.map(doc => doc.data()); return cityList; }

Clone this wiki locally