jmespath.site icon indicating copy to clipboard operation
jmespath.site copied to clipboard

Need the ability to unique a list

Open DanielFTwum opened this issue 6 years ago • 2 comments

Need the ability to get a unique list of elements in an array (similar to UNIX uniq)

Say I have an array { "result": [ "G", "L", "G", "G", "L" ] }

uniq(result) yields [ "G", "L" ]

DanielFTwum avatar Mar 27 '18 01:03 DanielFTwum

I honestly think it can't be done right now with JMESPath. Just try the last tip here (new Set() from ES2015): https://www.jstips.co/en/javascript/deduplicate-an-array/

maxxyme avatar Sep 27 '18 13:09 maxxyme

This document is intended to help you, jmespath.py

CustomFunctions

abeelan avatar Dec 02 '21 10:12 abeelan