私はキャッシュ内にオブジェクトストアを持っています。私はキャッシュからデータを取得し、その上にフィルタ条件を適用する必要があります。データウェアラブのフィルタ条件で動的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の中にフィールド名とfieldValueの設定やflowVars – AnupamBhusari
我々ははcustomerIdかのようにフィールド名を取得するマッピングを上からこの フィールド名=はcustomerId&fieldValueの= 101810 – Gopi
などの要求から来るクエリのparamsとしてそれらを取得しているために使用されるコードを投稿してくださいCustomerNameまたはCustomerAddressはデータをフィルタリングし、filedVauleはそのフィールドの対応する値です。[{ \t \t \t "ラベル": "530"、 \t \t \t "コンテンツ":{ \t \t \t \t「あなたは{ \t "行" と入力(JSON)を見つけてください。この – Gopi