del

utility

Removes a key from an object

Syntax

del(object, key)

Parameters

object (object)

The object to modify (implicit when used in pipeline)

key (string)

The key to remove

Returns

object

The object with the specified key removed

Examples

Remove password field
Input:
map(del("password"))
Output:
[{name: "Alice", email: "[email protected]"}]
Remove temporary field
Input:
del("temp_field")
Output:
{name: "Alice", age: 30}

The del() function removes a specified key from an object.

Usage

Use del() to remove sensitive fields, clean up temporary data, or exclude unwanted properties from objects.