Hi,

is there a way to merge array values?

Something that transforms

{
  "k1": "1",
  "k2": ["a", "b"] 
},
{
  "k1": "2",
  "k2": ["c", "d"] 
},
{
  "k1": "2",
  "k2": ["e", "f"] 
}

into 

{
  "k1": "1",
  "k2": ["a", "b"] 
},
{
  "k1": "2",
  "k2": ["c", "d", "e", "f"] 
}


And an inverse of cartesianProduct() that transforms

{
  "k1": "1",
  "k2": "a"
},
{
  "k1": "2",
  "k2": "b"
},
{
  "k1": "2",
  "k2": "c"
}

into 

{
  "k1": "1",
  "k2": ["a"]
},
{
  "k1": "2",
  "k2": ["b", "c"] 
}


Christian


Reply via email to