캐시에 데이터가 저장되어 있습니다 (예 : objectstore). 캐시에서 데이터를 가져 와서 필터 조건을 적용해야합니다.데이터웨어 뮬의 필터 조건에서 동적 fieldName을 전달하는 방법
이 요구 사항은 요청에서 동적으로 제공 될 filedName 및 filedValue를 기반으로 데이터를 가져 오기 위해 api를 노출해야합니다.
샘플 요청 :
https://localhost:8082/api/customer/filter?fieldName=customerId&fieldValue=101810
내가 dataweave의 데이터를 필터링 할 반환 코드를 가지고 있지만 작동하지 않습니다. 이
%dw 1.0
%output application/json
---
payload.rows filter (("$.content." ++ flowVars.fieldName ++ ".content") as :string == flowVars.fieldValue as :string) map ((row , indexOfRow) -> {
customerId: row.content.customerId.content as :string when row.content.customerId.content != null otherwise null,
customerName: row.content.customerName.content as :string when row.content.customerName.content != null otherwise null,
customerAddress:row.content.customerAddress.content as :string when row.content.customerAddress.content != null otherwise null
})
에 도움을 주시기 바랍니다 수 있으며, 당신이 문제는 선택에 사용되는 코드로는 $.content[flowVars.fieldName].content
같이해야한다이
는 objectstore에 fieldName에와 fieldValue의 설정 또는 flowVars – AnupamBhusari
우리는 고객 ID를 또는 fieldName은 얻을 것이다지도 위에서이 은 fieldName = 고객 ID를 & fieldValue의 = 101,810 – Gopi
같은 요청에서 올 것이다 검색어 매개 변수로를 점점에 사용되는 코드를 게시하시기 바랍니다 CustomerName 또는 CustomerAddress는 데이터를 필터링하고 filedVaule은 해당 필드의 해당 값입니다.[{ \t \t \t "라벨": "530", \t \t \t "내용": { \t \t \t \t "당신은 { \t"행 "등이 – Gopi