After spending hours searching, I still can't find a solution to my problem with this code. The Firebase log file only shows:
"after for each =undefinedsensor_location_1undefinedundefinedundefined "
Why is it only referencing the first document (in this case, location_id) for each Sensor in the Firestore Database?
The path is occupation.sensor_n.location_id/reserved_by.........
admin.firestore().collection("occupation").get().then((sensors:any) => {
sensors.forEach((sensor:any) =>{
console.log("after for each=" + sensor.id + sensor.location_id + sensor.reserved_by + sensor.occupied); //collection_id is working
Any help would be greatly appreciated.