# Apply transformation on nested object fields (based on dot notation)

**URL:** https://discourse.nodered.org/t/apply-transformation-on-nested-object-fields-based-on-dot-notation/53906
**Category:** Developing Nodes
**Created:** [17 November 2021 20:00 UTC](https://discourse.nodered.org/t/apply-transformation-on-nested-object-fields-based-on-dot-notation/53906 "2021-11-17T20:00:00Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [20 December 2021 06:17 UTC](https://discourse.nodered.org/t/apply-transformation-on-nested-object-fields-based-on-dot-notation/53906/12 "2021-12-20T06:17:42Z")

</div>

Hi @drmibell,

I got it working using the Jsonata transforms. And it works fine!

However few days afterwards my Node-RED became suddenly completely unresponsive, and I had no clue what was causing that. So I started experimenting with profiling in Node-RED (via [ClinicJs](https://discourse.nodered.org/t/profiling-flows-with-clinicjs-to-analyze-cpu-performance-issues/55139), my [message tracer](https://discourse.nodered.org/t/announce-node-red-contrib-msg-profiler-1-0-0-beta/54609/9) and my [own](https://discourse.nodered.org/t/cpu-profiling-a-single-node-collecting-ideas/55012) profiler), and via all ways it immediately became visible that my Jsonata transforms were causing this:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f3a5086d236b1cb8a06b1f7a3339bb3ff0713d79.png)

Jsonata does _not_ modify (see [here](https://github.com/jsonata-js/jsonata/issues/70#issuecomment-320630934)) the original input objects, instead it _ **deep clones the input msg** _ and it transforms the clone and returns that modified clone.

However my new custom node - for which I need tranformations - is used to handle images from camera streams, so those messages contain LOTs of data. The image cloning was causing all my troubles, because that is something that need to be avoided as much as possible when dealing with images.

So I ended up writing my own custom transformation (with my own expression syntax) at the end, and that works MUCH faster because I now transform the original input message ...

Summarized: the Jsonata transforms work very well, but be aware about the performance impact! It all depends on the amount of data in your input messages...

---

_[View the full topic](https://discourse.nodered.org/t/apply-transformation-on-nested-object-fields-based-on-dot-notation/53906)._
