v.21.11New Features
New functions mapContainsKeyLike and mapExtractKeyLike for regex operations in maps
New functionmapContainsKeyLiketo get the map that key matches a simple regular expression. #29471 (凌涛). New functionmapExtractKeyLiketo get the map only kept elements matched specified pattern. #30793 (凌涛).
Why it matters
These functions enable users to efficiently query map data structures by matching keys with a pattern, allowing for selective retrieval and existence checks of map elements that satisfy the specified key pattern. This enhances flexibility and expressiveness when working with complex map data.How to use it
UsemapContainsKeyLike(map, pattern) to check if any key in the map matches the given simple regular expression pattern. Use mapExtractKeyLike(map, pattern) to return a new map containing only the key-value pairs where the key matches the specified pattern.