Skip to main content

query

Function query 

Source
pub fn query(value: &Value, path: &str) -> Result<Value, NikaError>
Expand description

Evaluate a RFC 9535 JSONPath expression against a JSON value.

Returns:

  • Null when no nodes match
  • The single value when exactly one node matches
  • An array of values when multiple nodes match

Use this for rich expressions with wildcards, filters, slices, or recursive descent. For simple $.a.b[0] paths, prefer resolve() which avoids the RFC parser overhead.