jsonata-js / jsonata

JSONata query and transformation language - http://jsonata.org
MIT License
2.05k stars 220 forks source link

How to work with parent object and transform values #688

Open mwpowellhtx opened 5 months ago

mwpowellhtx commented 5 months ago

I have a JSON in the following structure, how would we express this transformation. Note that we want the result to be the same shape as the input.

{
  "99": { "Price": 999 }
  , ...
}

We have the JSON object, key value associative pairs, the object on the RHS has a "Price", can have other kvp as well, all should remain in tact. The only thing we want to do is transform the Price accordingly.

How might we go about doing that with the JSON-aytah ?

Note, I am no stranger to data shapes, transformations, etc; so high level guidance. If it is even possible with JSON-ata.

Thank! Cheers. 🍻