I have json object as follows {"resources":[{"srno":"1","name":"name1","projects":[{"prjname":"abc"}]},{"srno":"1","name":"name1","projects":[{"prjname":"def"}]},{"srno":"2","name":"name2","projects":[{"prjname":"abc"}]},{"srno":"4","name":"name4","projects":[{"prjname":"prq"}]},{"srno":"4","name":"name4","projects":[{"prjname":"stu"}]},{"srno":"4","name":"name4","projects":[{"prjname":"uvw"}]},{"srno":"5","name":"name5"}]} How can I get resources grouped by id,name - each of that should contain list of projects? basically,flattened to structured i.e. {"resources":[{"srno":"1","name":"name1","projects":[{"prjname":"abc"},{"prjname":"def"}]},{"srno":"2","name":"name2","projects":[{"prjname":"abc"}]},{"srno":"4","name":"name4","projects":[{"prjname":"prq"},{"prjname":"stu"},{"prjname":"uvw"}]},{"srno":"5","name":"name5"}]} can someone share jsonata expression to create same