transform_keys
utilityTransforms all object keys
Syntax
transform_keys(object, function) Parameters
object (object) The object to transform (implicit when used in pipeline)
function (expression) Transformation function to apply to each key
Returns
object Object with transformed keys
Examples
Uppercase all keys
Input:
transform_keys(toupper) Output:
{NAME: "Alice", AGE: 30} Convert keys to snake_case
Input:
transform_keys(snake_case) Output:
{user_name: "Alice", user_age: 30} The transform_keys() function applies a transformation function to all keys in an object.
Usage
Use transform_keys() to normalize object keys, convert naming conventions, or apply consistent formatting to field names.