get data from firestore

Solutions on MaxInterview for get data from firestore by the best coders in the world

showing results for - "get data from firestore"
Ana Sofia
11 May 2017
1    db.collection("users").get().then((querySnapshot) => {
2    querySnapshot.forEach((doc) => {
3        console.log(`${doc.id} => ${doc.data()}`);
4    });
5
Joshua
08 Jul 2017
1useEffect(() => {
2	db.collection('posts')
3      .orderBy('timestamp', 'asc') // optional
4      .onSnapshot((snapshot) => {
5		setPosts(
6			snapshot.docs.map((doc) => {
7				return doc.data();
8			})
9		);
10	});
11}, []);
Bray
18 Jan 2021
1const [hospitalsDetails, setHospitalsDetails] = useState([])
2    useEffect(()=>{
3        //load hospitals into hospitalsList
4        const hospitals = []
5        db.collection('Hospitals').get()
6            .then(snapshot => {
7                snapshot.docs.forEach(hospital => {
8                    let currentID = hospital.id
9                    let appObj = { ...hospital.data(), ['id']: currentID }
10                    hospitals.push(appObj)
11
12                    hospitals.push(hospital.data())
13            })
14            setHospitalsDetails(hospitals)
15        })
16    },[])
17
queries leading to this page
how to get data from firestorehow can we get data from firebase firestorefetch firestorefirebase get methodfirestore get valueget data from firebase using firestorehow to get data from firebase collectionfirebase get data from firestoreget data for collection fierbasefirestore get data with jsfirestore get collection datahow to find pk id firestoreget data from firebase firestore 9fetch data from firebase cloud firestorefirestore get all documents in collectionget data from collection firestoreget collection data firestoreget data from cloud firestorefirebase get id with dataget data from snapshot firestorehow to get all documents in a collection firestoreget data from firebasefirestore where queryget document data firestorefirestore list docsget data collection firebaseget firestore datafirestore get entire collectionget all documents from a collection firestore flutterfirestore query by fieldhow to get document id in firestoreget info from a firebase firestore documentget all data from collection firestorefirebase create data in firestore and get data from databasefirebase get documentfirebase find a field in all documentsget data from firebase firestore realtimereading documents from a collection firebasefirebase querysnapshot then 28 29firebase get all documents in collectionfirestore get all documentshow to get data from collection of firebaseget data from firestorefirestore get doc idget specific documents from cloudfirestoreget then firebasehow to get data from firebase get data in a collection firestoreget all data from firestorefirestore get all data snap in collectionfirestore get data from referencedoc getfirestore read datafirebase firestore get document from another collection using idget collection data from firebasefirestore collection getget data firestorefirebase get all dataget data in from a collection firestorehow to get data from collection get firebaseget all data from a collection firebase 3fget firestore data from snapshot react jsget all user collection firebaseget data from firebase firestoreget data from collection firebaseget data from collection reference firestorefirestore get data webfirebase database firestore get document datafirestore get document fieldsfetch specific data from firestorefirestore find document by idget data cloud firestore jsfirebase list all documents in collectionread cloud firestore datafirebase get datahow to get the document with id in firebase functionsget multiple documents firestoreread data from firestorehow to get data from collection firebaseget all documents in collection firestoreget data from firestore documentfetch all the data in a collection firestorehow to get document data in firestore firestore collection getfirestore get field from documentget data from firestore collectionget data from collection in firebasefirebase get documentsdb collection 28 29 docs in firebaseretrieve data from firebasefirebase get doc by idget collection from firebasedb collection where androidget data from doc firestoreget all data in firestorefirebase collection getfirebase function get data from firestorequery data from firestorefirestore query javascripthow to get data from firebase firestorehow to get every doc from firestoreget from firestorefirebase get firestore dataget collection firestorefirestore get collection by fieldhow to get doc id firebaseget method in firestorefirestore get dataget all data from firestore collectionget data from firestore