DataWeave : How to handle specific key from objects

preview_player
Показать описание
Are you willing to handle a specific key from an object? Given a JSON object, you’re eager to remove a particular key? Otherwise, are you attempting to rename it? What if you’re willing to transform an array object attribute into a string? In this video, Lorenzo would like to share his “How(s) to” with you.

If you have any Questions and Feedback, feel free to leave it in the Comment Section!

Follow us
---------------------------------------------------

Chapters
---------------------------------------------------
00:00 - Introduction
00:50 - mapObject: the solution for our problem
01:35 - Deep dive with a complex-easy example
02:00 - How does it work key recognition
03:20 - A solution(s) to key recognition
03:55 - How to remove a specific key from an object
04:40 - How to handle complex object by specific key
05:35 - Combine all together

Music from Epidemic sound
---------------------------------------------------

---------------------------------------------------
Video by Intrepide Studio
Рекомендации по теме
Комментарии
Автор

Hi Lorenzo! The reason why the equal is not working is the same that you are getting a warning. Keys in DataWeave are not Strings but rather a different data structure that is formed of a QName and attributes. So as you mentioned you can cast a Key to a String or you can use the similar comparator key ~= "surname". This has nothing to do with the type of the payload as in DataWeave it doesn't matter if the payload is Json XML Excell or whatever it is always represented in the cannonical representation. BTW Thanks for posting the video

machaval
welcome to shbcf.ru