ModelWorks logoModelWorks
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

OptionTypeRequiredDefaultDescription
pathsarray<string>YesDot-separated paths to remove.

Example

Input

JSON
{
  "user": {
    "id": 1,
    "profile": { "name": "Ada", "secret": "shh" }
  },
  "audit": { "ip": "127.0.0.1" }
}

Operation

JSON
{
  "type": "unset",
  "options": {
    "paths": ["user.profile.secret", "audit"]
  }
}

Output

JSON
{
  "user": {
    "id": 1,
    "profile": { "name": "Ada" }
  }
}

In a Circuit Step

JSON
{
  "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 object if 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 unset or omit if you need to clean those up.
  • paths does not support array indices.
On this page

On this page