我反对如下:
{"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"}]}
一个人可以分享“jsonata”的表述,从而产生同样的效果。