Cloud Function with Schedule

后端 未结 1 434
南旧
南旧 2021-01-23 13:25

I am trying to do a cloud function by adding a Schedule to change the status of a node inside firebase, which is {active: true} to {active: false}

const admin =          


        
相关标签:
1条回答
  • 2021-01-23 13:55

    What you're trying to do isn't possible. You can't declare and export a function inside another function declaration. If you want something to run on a schedule, you will have to declare and export it at the top level of the file.

    What you can do instead is have your function run on a schedule, but query Firestore to see how it should operate on each invocation.

    0 讨论(0)
提交回复
热议问题