JSON TransformObject
unset
Remove values at one or more dot-separated paths
unset
Removes values at every dot-separated path in paths. Missing paths are silently ignored.
Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
paths | array<string> | Yes | — | Dot-separated paths to remove. |
Example
Input
{
"user": {
"id": 1,
"profile": { "name": "Ada", "secret": "shh" }
},
"audit": { "ip": "127.0.0.1" }
}Operation
{
"type": "unset",
"options": {
"paths": ["user.profile.secret", "audit"]
}
}Output
{
"user": {
"id": 1,
"profile": { "name": "Ada" }
}
}In a Circuit Step
{
"name": "scrub_sensitive_paths",
"description": "Remove the user's secret and the entire audit block",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ record }}",
"operations": [
{
"type": "unset",
"options": {
"paths": ["user.profile.secret", "audit"]
}
}
]
},
"outputs": [
{
"name": "scrubbed_record",
"description": "Record with sensitive paths removed",
"value": "${{ scrub_sensitive_paths.output.transformed_result }}"
}
]
}Notes & gotchas
- Errors with
unset: expected objectif the input is not an object. - Each path traverses through objects only. If any intermediate segment is not an object, removal stops silently — there's no error for "path not found".
- Empty objects left behind by removal are not garbage-collected automatically. Run another
unsetoromitif you need to clean those up. pathsdoes not support array indices.