amazon-web-services - 在“或”条件下过滤 AWS SNS 消息
问题描述
在SNS 消息过滤页面上有一个 AND/OR Logic 的示例,如下所示
AND 逻辑:通过使用多个属性名称(键)应用 AND 逻辑。例如,政策:
{
"customer_interests": ["rugby"],
"price_usd": [{"numeric":[">", 100]}]
}
OR 逻辑:通过为属性名称分配多个值来应用 OR 逻辑。例如,策略属性:
"customer_interests": ["rugby", "football", "baseball"]
但是,我们如何为多个属性名称(键)应用“或”逻辑
因此,例如,如果我想更改第一个示例,政策将是什么
从
(customer_interests="rugby" AND price_usd > 100)
至
(customer_interests="rugby" OR price_usd > 100)
解决方案
您必须为同一端点创建 2 个单独的订阅并附加不同的过滤器:
第一次订阅:
{
"customer_interests": ["rugby"]
}
第二次订阅:
{
"price_usd": [{"numeric":[">", 100]}]
}
我没有找到任何在单个过滤器中使用 OR 的方法,但是通过创建对同一端点的多个订阅肯定有效(在我的帐户上使用了 mysqlf)
推荐阅读
- python - 按日期时间合并行数据
- sql - 如何返回左侧的所有行,除非项目在右侧存在但不匹配
- flutter - 如何在颤振中创建此 UI?
- javascript - 逆for循环组成搜索字符串
- node.js - 如何在 gdscript 中订阅 adonisjs 网络套接字频道?
- python - UnboundLocalError:在服务器端分配之前引用了局部变量“插入”
- java - 在声明图像或文本视图时减少代码行数
- python - 实时将控制台输出重定向到 pyqt5 gui
- java - 从 Splunk 中的列表进行统计
- html - 银行系统日志问题,记录操作的负载数,用于跟踪贷款在其生命周期内