Ich habe Daten im Cache, d. H. Objectstore. Ich muss die Daten aus dem Cache abrufen und die Filterbedingung anwenden.Wie übergebe ich das dynamische fieldName im Filterzustand von dataweave mule
Hier ist Voraussetzung, ich muss API offen legen, um die Daten basierend auf filedName und filedValue, die dynamisch in der Anfrage kommen werden.
Probe Anfrage:
https://localhost:8082/api/customer/filter?fieldName=customerId&fieldValue=101810
I Return-Code haben die Daten in dataweave zu filtern, aber es funktioniert nicht. Sie können auf dieser
%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
})
helfen bitte und ich unten Störung erhalte
Exception while executing:
payload.rows filter (("$.content." ++ flowVars.fieldName ++ ".content") as :string == flowVars.fieldValue as :string) map ((row , indexOfRow) -> {
^
Type mismatch for '++' operator
found :object, :string
required :string, :string.
können Sie auf dieser
bitte Code schreiben, die für die Einstellung Feldname und fieldvalue in Objektspeicher oder flowVars – AnupamBhusari
bekommen wir sie als Abfrage params verwendet wird, die von der Anfrage wie diese fieldname = customerId & fieldvalue = 101810 – Gopi
von oben Mapping kommen wir Feldname als customerId erhalten wird oder CustomerName oder CustomerAddress zum Filtern der Daten und filedVaule ist der entsprechende Wert dieses Feldes. \t \t \t "Inhalt" "530",:: { \t \t \t \t "[{ \t \t \t "label": Können Sie bitte auf diesen – Gopi