Created
August 20, 2020 02:20
-
-
Save pablohdzvizcarra/631ecf63d5ee6b1bdcc00a2c8d461e2c to your computer and use it in GitHub Desktop.
get data firebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async getMarkers() { | |
const events = await firebase.firestore().collection('events') | |
events.get().then((querySnapshot) => { | |
const tempDoc = querySnapshot.docs.map((doc) => { | |
return { id: doc.id, ...doc.data() } | |
}) | |
console.log(tempDoc) | |
}) | |
} | |
async getMarkers() { | |
const events = await firebase.firestore().collection('events') | |
events.get().then((querySnapshot) => { | |
const tempDoc = [] | |
querySnapshot.forEach((doc) => { | |
tempDoc.push({ id: doc.id, ...doc.data() }) | |
}) | |
console.log(tempDoc) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment