Skip to content

Filter queries

A filter query selects the objects of an array that meet your conditions, for example the orders over 100 that are not shipped. It works on JSON files of any size, without loading them into memory. The matching objects are highlighted in the tree, and you step through them one by one.

A filter tests each object at the top of a JSON array, or the root object of a document. To query an NDJSON file, use jq or SQL.

  1. Press Ctrl+Shift+L, or choose Search → Filter Objects…. The query bar opens on the Filter tab.

  2. Type the conditions, for example:

    total > 100 AND status != "shipped"

    As you type a field, the query bar suggests the document’s fields; press Tab to accept one. After a field, it suggests the operators.

  3. Press Enter.

The tree goes to the first matching object, and the query bar shows your position, for example 1 of 12. If the query has a mistake, the query bar shows Error; hover over it to read what is wrong.

A condition compares a field with a value:

Condition Matches objects where
status = "active" status is the string active
age > 30 age is a number greater than 30
name contains "smith" name contains smith, ignoring case
email ~ "@example\.com$" email matches the regular expression
address.city = "Paris" the nested field address.city is Paris
tags.* = "vip" any element of the tags array is vip

Combine conditions with AND, OR, and NOT, and group them with parentheses:

(country = "FR" OR country = "BE") AND NOT archived = true

Write text values in double quotes. A field that an object does not have counts as null. For every operator and rule, see Filter language.

Press Enter or select the down arrow for the next match, and Shift+Enter or the up arrow for the previous one. When you change the query, Enter runs it again.

To copy every matching object as JSON, select Copy matched objects as JSON.

The query bar runs filter, JSONPath, jq, and SQL queries over the whole document. Open it on any tab:

Tab Shortcut Command
Filter Ctrl+Shift+L Search → Filter Objects…
JSONPath Ctrl+Shift+J Search → JSONPath Query…
jq Ctrl+J Search → jq Query…
SQL Ctrl+E Search → SQL Query…

Ctrl+Shift+Q (Open Query Bar) opens the query bar, and closes it when it is open.

  • History: press Up and Down in the query box to step through your recent queries; in the SQL tab, press Ctrl+Up and Ctrl+Down.
  • Syntax reference: the question mark button opens a sheet with the syntax of each language and examples. Click an example to put it in the query box.
  • Close: press Esc. The query stays in the box for next time.