-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathf.js
More file actions
22 lines (19 loc) · 730 Bytes
/
f.js
File metadata and controls
22 lines (19 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Install: npm install firebase
import { initializeApp } from 'firebase/app';
import { getFirestore, collection, getDocs } from 'firebase/firestore';
const firebaseConfig = {
apiKey: "AIzaSyD2Q3ziWpGpSabeFijT0LmvnE3pEHZEs5g",
authDomain: "opensys-26.firebaseapp.com",
projectId: "opensys-26",
storageBucket: "opensys-26.firebasestorage.app",
messagingSenderId: "524840912682",
appId: "1:524840912682:web:fe40a3ceb89e5e16f8c053",
measurementId: "G-6GCP7K3KFQ"
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
// Read a collection
const querySnapshot = await getDocs(collection(db, "your-collection-name"));
querySnapshot.forEach((doc) => {
console.log(doc.id, " => ", doc.data());
});