我正在获取带有多个Id记录的JSON。我只需要父级别ID,如下图所示。 JSON路径是:.Id,见下面的:
目前我要回复所有Id:
LoanHistoryIDs_1=54bb6a6ecbda714f6c1c4348
LoanHistoryIDs_2=5570675ecbda712418a92f4c
LoanHistoryIDs_3=53fed26acbda7151983a9d18
LoanHistoryIDs_4=54bb6a6ccbda714f6c1c4344
LoanHistoryIDs_5=54bb6a6ecbda714f6c1c4349
LoanHistoryIDs_6=54bb6a6dcbda714f6cffd23f
LoanHistoryIDs_7=53fed26acbda7151983a9d18
LoanHistoryIDs_8=54bb6a6ccbda714f6c1c4344
我如何只过滤我需要的东西?
来自评论的JSON的一部分:
[{" Id":" 54bb6a6ecbda714f6c1c4348"," Lenders":[{" Id":" 5570675ecbda712418a92f4c&#34 ;,"名称":" MORGAN STANLEY MORTGAGE CAPITAL HOLDINGS LLC" },"借款人":[{" Id":" 53fed26acbda7151983a9d18","姓名":" 120" }]," TransactionDate":null," Type":" Original Loan"," Date":" 2013-12- 16T00:00:00Z","金额":135," MaturityDate":" 2020-01-01T00:00:00Z","结构":" CMBS"," CMBSList":[{" Id":" 54bb6a6ccbda714f6c1c4344"," Name&#34 ;:"摩根士丹利美国银行美林信托2014-C14" }]},{" Id":" 54bb6a6ecbda714f6c1c4349",
答案 0 :(得分:1)
您不需要插件,使用JSON Extractor和$.Id
作为JSON路径表达式值来获取root下的id值,不包括层次结构中的其他ID
修改强>
如果使用JSON数组,或[0].Id
代表所有ID,或[*].Id
代表所有ID。