Delete multiple keys from Map
- SnehaOP 3
Hi Team,
How to delete multiple keys from a Map in Daml?
Key deletion for single element :
M.delete “ABC” dataMapIn similar to above what is the syntax to delete lets says “ABD” and “XYZ” keys from dataMap.
- cocreature 2
Hi @Sneha, you can chain multiple calls to
delete, e.g.,M.delete "ABD" (M.delete "XYZ" dataMap)If you have a list, you can use
foldlto delete all of them:foldl (\acc key -> M.delete key acc) dataMap keysToDelete - Sneha 2
This helps. Thank you @cocreature for quick response.