Step: Nested fields: .foo.bar

Nested fields: .foo.bar

Chain keys to reach into nested objects: .foo.bar. It's exactly the same as piping single steps: .foo | .bar.

Pitfall: if any link in the chain is null, the whole expression errors unless you make it optional (.foo?.bar). More on ? shortly.

Your turn: pull the city out of location.

Input:
{
  "firstName": "Charles",
  "lastName": "Doe",
  "location": {
    "city": "San Francisco",
    "postal-code": "94103"
  }
}
Expected:
"San Francisco"
Step 3 of 27