Skip to main content

Command Palette

Search for a command to run...

Filter JSON node easily with JSON Path

Published
1 min read

It's easy to filter the nodes of the JSON with some simple syntax of JSON Path. Below are the notes of some practical scenarios of filtering:

Filter by date time and contains

To be able to filter the expenses by two fields. One is the expenseDate need to be a date after a certain point in time. The other is itemName which contains a given keyword taxi. Example:

$.[?(@.expenseDate >= '2023-03-01T00:00:00' & /taxi/i.test(@.itemName))]