如何從這個JSON字符串中的數組paramList(在name":"offset","values":["90"]
的開頭)檢索值90?如何從嵌套的JSON字符串中的數組中檢索值?
{"query":{"query":"skole","hits":10,"paramList":[{"name":"hits","values":["10"]},{"name":"offset","values":["90"]},{"name":"q","values":["skole"]}]},"status":"success","facets":[{"selectionType":"AND","numberOfItems":1,"selectableItems":[{"value":"Intranett","displayName":"Intranett","count":146,"paramId":"?hits=10&q=skole&kilde=Intranett"}],"appliedItems":[],"facetName":"Kilde"},{"selectionType":"AND","numberOfItems":4,"selectableItems":[{"value":"EPiServerPage","displayName":"EPiServerPage","count":90,"paramId":"?hits=10&q=skole&type_s=EPiServerPage"},{"value":"Word","displayName":"Word","count":51,"paramId":"?hits=10&q=skole&type_s=Word"},{"value":"ClubNews","displayName":"ClubNews","count":4,"paramId":"?hits=10&q=skole&type_s=ClubNews"},{"value":"Project","displayName":"Project","count":1,"paramId":"?hits=10&q=skole&type_s=Project"}],"appliedItems":[],"facetName":"Type"}],"suggestions":{"displayName":"spellingSuggestion","suggestions":null,"collatedSuggestion":{"suggestion":null,"paramId":"?q=null"}},"errors":[],"numberOfHits":146,"pagination":{"offset":90,"first":{"displayName":"1","selected":false,"end":10,"start":1,"paramId":"?hits=10&q=skole&offset=1"},"next":{"displayName":"11","selected":false,"end":109,"start":100,"paramId":"?hits=10&q=skole&offset=100"},"hitsPerPage":10,"paginationItems":[{"displayName":"5","selected":false,"end":49,"start":40,"paramId":"?hits=10&q=skole&offset=40"},{"displayName":"6","selected":false,"end":59,"start":50,"paramId":"?hits=10&q=skole&offset=50"}, .....
爲了檢索(第一行的開始)的元件查詢我使用{$T.query.query}
'values'是一個數組,而這正是這個表達式會。 –
也,即使這*是正確的,它將返回10,而不是90 –
@PhillipSchmidt:對不起,更正和更新。感謝您的高舉。 –