0
我在我的表的文檔有jsonb列(gppermission)數據作爲JSON數組,它包含數據搜索一個JSON數組中jsonb列具有posgresql
[{"Deny": "true", "Allow": "false", "GroupName": "Group 1 "},
{"Deny": "false", "Allow": "true", "GroupName": "Group 2 "},
{"Deny": "false", "Allow": "true", "GroupName": "Group 3 "},
{"Deny": "true", "Allow": "false", "GroupName": "Group 4 "}]
我需要在這個數據中搜索
{"Deny": "false", "Allow": "true", "GroupName": "Group 3 "}
我試過了下面的查詢。但沒有結果:(
select * from doc as dc ,jsonb_array_elements(dc.gppermission) as e(gp) where e.gp = '{"Deny":"false","Allow":"true","GroupName":"Group 3"}'
鋸Query for array elements inside JSON type但它的「對象」的參考,我的JSON數組是不同
請幫助...
[對於內部JSON類型的數組元素的查詢(的可能的複製http://stackoverflow.com/questions/22736742/query-for-array-elements-inside-json-類型) – cske