Sort a list of key-values elements
Dear community,
I have the following question.
I have list called list_values:
- list_values = {{"name":'Carl',"age":6},{"name":'Adam',"age":8},{"name":'Bob',"age":9}};
I want to reorder the list values based on the name key of each key-value element, the output should be like this:
I will reorder alphabetically based on the "name":
- list_values_ordered = {{"name":'Adam',"age":8},{"name":'Bob',"age":9},{"name":'Carl',"age":6}};
Does someone know how can I get this done?
Thank you very much.
Kind regards,