I hope somebody can help me, I am searching for hours. The problem in this code is that in the log file of Firebase there only stands:
"after for each =undefinedsensor_location_1undefinedundefinedundefined "
so why does it only use the first document (in this case it is location_id which is the first document 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
Thanks for your help