Functions that work with parsed paths, specifically path enumeration over JSON values.
Functions that work with parsed paths, specifically path enumeration over JSON values.
(path-seqs json-obj json-path)
Given a JSON object and a parsed JSONPath, return a seq of maps with the following fields: :json the JSON value at the JSONPath location. :path the definite JSONPath that was traversed. :fail if the JSONPath traversal failed due to missing keys or indices
Given a JSON object and a parsed JSONPath, return a seq of maps with the following fields: :json the JSON value at the JSONPath location. :path the definite JSONPath that was traversed. :fail if the JSONPath traversal failed due to missing keys or indices
(speculative-path-seqs json-obj json-path wildcard-append? wildcard-limit)
Similar to path-seqs
, except it continues traversing the path even if
the location in the JSON data is missing or incompatible. Returns the
same fields as path-seqs except for :fail
.
Accepts two more args: wildcard-append?
, which dictates if wildcard values
should be appended to the end of existing seqs (default true
), and
wildcard-limit
, dictating how many wildcard paths should be generated
(defaults to 1 in append mode, the coll size in overwrite mode).
Note that too many wildcards in json-path
, or too large of a value of
wildcard-limit
, may lead to exponential blowup.
Similar to `path-seqs`, except it continues traversing the path even if the location in the JSON data is missing or incompatible. Returns the same fields as path-seqs except for `:fail`. Accepts two more args: `wildcard-append?`, which dictates if wildcard values should be appended to the end of existing seqs (default `true`), and `wildcard-limit`, dictating how many wildcard paths should be generated (defaults to 1 in append mode, the coll size in overwrite mode). Note that too many wildcards in `json-path`, or too large of a value of `wildcard-limit`, may lead to exponential blowup.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close