obtener document de collectiongroup code example

Example 1: collection get firesotre

async getMarker() {
    const snapshot = await firebase.firestore().collection('events').get()
    return snapshot.docs.map(doc => doc.data());
}

Example 2: multiple query at once in firebase

function doSomething(...){
    let result1 = [];
    let result2 = [];
    admin.firestore().collection('...').where('some condition').get()
    .then((results: any)=>{
        results.forEach((element: any)=>{
            if(some other condition){
                result1.push(element);
            }
    })
    .catch((error: any)=>{//log the error});
    admin.firestore().collection('...').where('yet another condition').orderBy(...).get()
    .then((results: any)=>{
        results.forEach((element: any)=>{
            result2.push(func(element))  //func is some manipulation
    })
    .catch((error: any)=>{//log the error});
    return makeCalculation(result1, result2);
}