經過幾個小時的閱讀和嘗試所有JSON路徑表達式進入我的腦海,無論是邏輯表達式和無意義表達式,我仍然不知道如何提取所有cmis:objectId
其中cmis:objectTypeId
從所有object
對象等於F:cm:custom
無論嵌套深度:JSONPath - 獲取對象其他值等於字符串的所有值
{
{... [... nested objects and arrays as needed for a tree strucutre
object : {
"succinctProperties": {
"cmis:objectTypeId": "F:cm:custom",
"cmis:objectId": "39cdd896-4563-4302-bba9-398006572522",
...
}
},
}... }... close nested objects and arrays as needed for a tree strucutre
"id": "e244881e-e96b-406b-8d1f-faecae35d7f2"
}
有些事情我想和我千百個嘗試保存:
$.[*]..succinctProperties[?(@['cmis:objectTypeId']=='F:wim:caseEntries')].cmis:objectId
$.[*]..succinctProperties.cmis:objectId // Returns ALL without condition
$.[*].*..succinctProperties[?(@.['cmis:objectTypeId']=='F:wim:caseEntries')]
$.[*]..succinctProperties[@.cmis:objectTypeId=='F:wim:caseEntries')].cmis:objectId
注:我使用http://www.jsonquerytool.com/,因爲我用的是JMeter的插件「JSON路徑抽出」,這一插件使用http://goessner.net/articles/JsonPath/
沒有人誰可以幫我:如果你有這樣的結構,它會因此只匹配的東西嗎?請:( – Pali