OmniJSON / Guide

Query large JSON with JSONPath Lite

Publisher and support: OmniJSON on the Chrome Web Store. Checked against version 0.1.14. Version notes; check the store listing for availability.

JSONPath Lite is OmniJSON’s structural query mode for large documents. After parsing finishes, use keys, array indices, wildcards or recursive key lookup to select matches. Predicates, slices, unions, functions and comparisons are not supported in Lite mode.

OmniJSON is an extension for desktop Chrome. Install it to try these steps with your own JSON.

Try a query on order data

Download the sample JSON, or save the example below as a JSON file. Open it in OmniJSON and wait for parsing to finish. In Search mode, enter a query beginning with $.

{
  "items": [
    {"id": 101, "status": "paid", "customer": {"name": "Ada"}},
    {"id": 102, "status": "pending", "customer": {"name": "Lin"}}
  ]
}

This small example runs in regular mode, but the queries below also belong to the Lite subset used for large documents. Results are matching nodes in the tree, not a newly exported JSON array.

Supported JSONPath Lite queries

Queries and expected matched values for the example
QueryWhat it selectsMatches
$.items[0].idID of the first item (indices start at zero)101
$.items[*].idEach item’s ID101, 102
$.items[*].customer.nameEach customer’s name"Ada", "Lin"
$..idEvery descendant field named id101, 102

Use Prev/Next to move through the matched nodes. A recursive lookup can match fields in different branches; use a specific path when only one branch is relevant.

What is different from full JSONPath?

Regular documents use full JSONPath subject to query budgets. From roughly 50 MB or 500,000 nodes, OmniJSON switches to large-document mode and JSONPath Lite. Both query modes wait for parsing to complete.

Choosing a filter for your task
TaskUseBehavior
Find text such as paidSearchSubstring matching across keys and scalar values; available while loading.
Keep fields named id and statusFields: id, statusExact key names with required parent paths and matched subtrees; available while loading.
Select IDs in an array$.items[*].idA structural query supported by Lite after parsing.
Filter objects by a value comparisonFull JSONPath, within regular-mode budgetsPredicates and comparisons are unavailable in Lite. Search is not an equivalent object predicate.

Lite also excludes slices, unions and functions. Unsupported queries are refused rather than silently treated as a different query. OmniJSON can copy jq-style paths, but it does not execute jq queries.

Copy a selected value or path

Select a matching row to inspect it. Copy its JSONPath, JavaScript path, jq path or key path, or use Copy value for the selected scalar. Scalar copy is capped at 4 MiB of decoded UTF-8 text; JSON escaping can make the literal larger. Subtree JSON copy is capped at 1 MiB and 10,000 nodes.

Large-mode inspector previews may be shortened and labelled with the full size. Copy uses the complete selected value within its budget, not the displayed preview. An oversized copy shows an error.

Get OmniJSON for Chrome