Skip to main content

How to Specify "null" in JSONPath

Written by Tominaga
Updated yesterday

Q: Specifying "null" in JSONPath isn't working.

What should I do?

A: Please replace null with nil when writing your expression.

Yoom’s web backend uses the Ruby programming language. In Ruby, the value that other languages usually call “null” is referred to as “nil”. To make sure the system understands your request, please use “nil” notation.

📍 Example: If you’re trying to target a field that has no value (a null value), instead of [?(@.last_sign_in_at.null?)].id, use [?(@.last_sign_in_at.nil?)].id.

Related Keywords

JSON, JSONPath, null, nil, filter, filtering, extraction, retrieved value, Ruby

Did this answer your question?