Skip to content

Multiple Key Selection

This features allows you to select multiple keys from an object.

Parenthesis

Use parenthesis () to group property names inside.

$.(users, employees)

Property Spacing

Be careful with spacing between the property names.

Invalid:

  • $.(users,employees)
  • $.(users,employees )
  • $.( users,employees)
  • $.(users ,employees)

Sample Data

json
{
  "name": "John Doe",
  "age": 30,
  "city": "New York"
}

Queries

ts
query.run("$.(name, age)") // { name: "John Doe", age: 30 }
query.run("$.(name, address)") // Error

DANGER

If any one of the keys does not exist, it will throw an error.