Map helpers in $util.map - AWS AppSync

Map helpers in $util.map

$util.map contains methods to help with common Map operations, such as removing or retaining items from a Map for filtering use cases.

$util.map.copyAndRetainAllKeys(Map, List) : Map

Makes a shallow copy of the first map, retaining only the keys specified in the list, if they are present. All other keys will be removed from the copy.

$util.map.copyAndRemoveAllKeys(Map, List) : Map

Makes a shallow copy of the first map, removing any entries where the key is specified in the list, if they are present. All other keys will be retained in the copy.