我们如何检查数组中的元素是否存在以及它的值是否为“true"?在普雷斯托 [英] how do we check if an element in the array exists and if it has a value of "true" in Presto

查看:26
本文介绍了我们如何检查数组中的元素是否存在以及它的值是否为“true"?在普雷斯托的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数组中的数据看起来像 XXXX:False".我用过

The data in the array looks like XXXX:"False". I used

element_at(array_name,'Field') 和 contains(map_keys(array_name),'Field').他们只检查元素是否存在于数组中.但是,如果字段"的值为真",我该如何检查该值?

element_at(array_name,'Field') and contains(map_keys(array_name),'Field'). They only check if the element is present in the array. But if the 'Field' has a value of 'true', How do i check that value?

推荐答案

假设你手头有一张地图,并且你想检查给定键的值,你可以使用 element_at():

Assuming that you have a map at hand, and that you want to check the value of of a given key, you can just use element_at():

where element_at(array_name, 'Field') = 'True'

这篇关于我们如何检查数组中的元素是否存在以及它的值是否为“true"?在普雷斯托的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆