我想实现一个函数,它查看已添加的集合并检查endTime是否等于或大于当前时间,然后它需要更新不同的集合文档 . According to the first image the car availability= false

In the second picture i have the document(key) called id. So once the current date and time is higher than endDate, then i want to update my document(s) availability= true

I have not store the date and time in the correct format i will update my code 我'm new to firebase functions. I'm在我的本机应用程序中使用它 . 使用Cloud Firestore来存储和更新我的数据