postgresql - 在存储过程 postgresql 中查找 jsonb 数组长度
问题描述
我通过在存储过程中使用 array_append 函数推送 jsonb 对象创建了一个 jsonb 数组(jsonb [])。但在那之后,我找不到那个 jsonb[] 的长度。我尝试过使用 jsonb_array_length(jsonb[])。但它显示错误,如“错误:函数 jsonb_array_length(jsonb[]) 不存在”。有人可以帮忙吗?
我的 jsonb 数组(flexibleWorkouts)类似于 {"{\"workoutId\": 1, \"workoutType\": \"Flexibility\", \"workoutCategory\": \"Activity\"}"}
我的代码是
jsonb_array_length(flexibleWorkouts)
解决方案
推荐阅读
- javascript - 在电子中进行 ipc 调用时,“TypeError:无法读取未定义的属性‘on’”
- javascript - 如何修改使用过的 css 框架产生的 css 内联元素?
- java - 正则表达式用嵌套括号分割java中的字符串
- kubernetes - 在Helm 中覆盖子图的值
- kubernetes - Ingress 可以根据 ip 路由请求吗?
- javascript - 代码战争 Persistent Bugger 问题与 if 语句未运行 for-loop
- android - 改造中的 CompositeException
- reactjs - 模拟在反应js中没有状态就无法工作
- vue.js - 监听 Vue 中所有子组件发出的事件
- matlab - 在 MATLAB 中执行 FFT 后的高频杂散