overview
Triggers are triggered by events to perform actions, for example, cloud functions are triggered when an operation (create, delete, update) is performed on a collection of documents. Using triggers, you can implement business logic more conveniently.
Simple three steps, add trigger
Step 1: Configure triggers
Enter the cloud development CloudBase console and click [Trigger] in the environment bar on the left.
Set the trigger name and select the trigger type: database (currently only supports databases, and will further support cloud storage, scheduled tasks, user status changes and other types in the future).
Determine execution status: You can choose whether the trigger will take effect immediately when it is created successfully.
Step 2: Set the conditions
According to the trigger type, set different types of conditions.
in:
Collection: Select the cloud database collection that needs to be monitored, and the document change in the collection will trigger an event.
Event type: write represents write operation, including update (update), delete (delete), insert (new)
Satisfaction conditions: including "unconditional trigger", "satisfy all of the following", "satisfy any of the following conditions".
The operators supported by the trigger and the field types matched by the operators are as follows:
Step 3: Add actions
The action will be triggered when the trigger meets the trigger condition.
Action type: currently only supports cloud functions, and will further support webhook, SMS and other types in the future.
Trigger frequency:
- Trigger every time
- Only trigger once
- Only trigger once in a period of time (supports setting time interval 6S-30 days)
Tips: Trigger partial restrictions
- A single trigger can be configured with 5 actions at most;
- The maximum of single trigger data is 256 KB, if it exceeds, it will be discarded;
- The single trigger frequency limit is 200 QPS.
The trigger capability is being continuously optimized. Experiences and feedback suggestions are welcome.
Immediately go to the cloud development CloudBase console experience: https://console.cloud.tencent.com/tcb
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。