How should I combine array values?

Answered

I have the following:

I want to replace userId:[3,14,2] with userIds: '3,14,2'.

Essentially I want to do a JOIN on the array.

I could have maybe 100 different JSON objects with arrays containing maybe 100 elements.

I can loop through all of the JSON objects in the result and then loop through all userIds appending them to a string variable. That is easy enough, but is that the best way to do this?

Could this be done with Lambdas? If so please provide some examples.

I would like to do the same with securityGroupId and securableEntityId.

3 replies