仅在提交特定云数据存储条目时触发 eventarc 事件

问题描述 投票:0回答:1

现在,我可以发送发生在特定云函数上的所有数据库写入操作。然而,这是非常低效的,如果我可以仅在编辑特定数据存储文档时过滤和发送数据,那就更好了。

如果这个问题没有意义,请告诉我!我很乐意详细说明。

我使用了路径模式。它只是不适用于任何实际条目。仅当路径模式引用数据库项目时才有效。

编辑:编辑我之前的*编辑的小垃圾社区模组,你就是这个社区仍然如此令人困惑的有毒的原因。

编辑:回答得很漂亮(查看评论)

If you use datastore today, you are (except for very special cases) using Cloud Firestore in Datastore Mode (more info). If you select the "Cloud Firestore" event provider in your eventarc trigger flow, you'll see the option for a "google.cloud.datastore.entity.v1.updated" event type. This event type will trigger for each entity changed in your google.datastore.v1.Datastore.Commit message and supports entity-path filtering. – Patrick Costello

google-cloud-platform google-cloud-datastore event-arc
1个回答
0
投票

如果您现在使用数据存储,则您(除了非常特殊的情况)正在数据存储模式下使用 Cloud Firestore(更多信息)。如果您在 eventarc 触发器流程中选择“Cloud Firestore”事件提供程序,您将看到

google.cloud.datastore.entity.v1.updated
事件类型的选项。此事件类型将为您的
google.datastore.v1.Datastore.Commit
消息中更改的每个实体触发,并支持实体路径过滤。

您仍然可以使用“云数据存储”事件提供程序来处理基于审核日志的事件(但是,在写入实体时,这些事件提供程序通常远不如上面定义的实体触发器有用。

© www.soinside.com 2019 - 2024. All rights reserved.