Given a Generic List of objects that contain a member variable that is a string, what is the best way to get the object that contains the string with the longest length?
ie. assuming val1 is the string I’m comparing:
0 : { val1 = 'a' } 1 : { val1 = 'aa' } 2 : { val1 = 'aba' } 3 : { val1 = 'c' }
what needs to be returned is object 2 because ‘aba’ has the greatest length.
Sorry, I’ll try again. You can use the following aggregation: