属性键匹配
您可以使用 exists
运算符返回在筛选策略中具有或不具有指定属性的传入消息:
-
使用
"exists": true
返回包含指定属性的传入消息。例如,以下属性使用值为
true
的exists
运算符:"store": [{"exists": true}]
它匹配包含
store
属性键的任意消息,如下所示:"store": "fans" "customer_interests": ["baseball", "basketball"]
但是,它不匹配不含
store
属性键的任何消息,如下所示:"customer_interests": ["baseball", "basketball"]
-
使用
"exists": false
返回不包含指定属性的传入消息。以下示例展示了使用值为
false
的exists
运算符的效果:"store": [{"exists": false}]
它不匹配包含
store
属性键的任意消息,如下所示:"store": "fans" "customer_interests": ["baseball", "basketball"]
但是,它匹配不含
store
属性键的任何消息,如下所示:"customer_interests": ["baseball", "basketball"]