I've been trying to code this in a way so that the values from the first query (referenced documentIDs) will be pushed into an array and then use a for loop to get the values from the array and use the documentIDs stored as part of the second query.
query.get().then(function(querySnapshot){
querySnapshot.forEach(function(doc){
reviewData.push(doc.data())
})
console.log(reviewData)
})
console.log(reviewData)
However, once the array is accessed outside of the get() function it returns it values as undefined despite it showing that the array has values. This is the result of the console.log outside the get() function
and this is the result for the console.log inside the get() function
One thing that i noticed though is that it seems the console.log from outside the get() function seems to be registered as an empty array despite having supposed values in it. How do i implement this properly so that I would be able to get the values of array.placesDocument and array.reviewDocument and use that as as a .doc() reference for a second and third query. Other solutions are also highly appreciated. Thanks!