forked from goops17/RideSharingWebApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
28 lines (25 loc) · 896 Bytes
/
test.js
File metadata and controls
28 lines (25 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Initialize Firebase
var config = {
apiKey: "AIzaSyApmRAMvcs-SDBL08lykImZENr2rifpqlg",
authDomain: "ride-sharing-4c8e7.firebaseapp.com",
databaseURL: "https://ride-sharing-4c8e7.firebaseio.com",
projectId: "ride-sharing-4c8e7",
storageBucket: "ride-sharing-4c8e7.appspot.com",
messagingSenderId: "217057301737"
};
firebase.initializeApp(config);
var db = firebase.firestore();
var docIDList = [];
//function autoGenerate {
db.collection("Users").get().then(function (querySnapshot) {
querySnapshot.forEach(function (doc) {
// doc.data() is never undefined for query doc snapshots
docIDList.push(doc.id);
dLength = docIDList.length; text = "<ul>";
for (i = 0; i < dLength; i++) {
text += "<li>" + docIDList[i] + "</li>";
}
text += "</ul>";
document.getElementById("test").innerHTML = text;
})
});