jqr_core: JQ Streaming API

Description Usage Arguments Examples

Description

Low level JQ API. First create a program using a 'query' and 'flags' and then feed pieces of data.

Usage

1
2
3
jqr_new(query, flags = jq_flags())

jqr_feed(jqr_program, json, unlist = TRUE, finalize = FALSE)

Arguments

query

string with a valid jq program

flags

See jq_flags

jqr_program

object returned by [jqr_new]

json

character vector with json data. If the JSON object is incomplete, you must set 'finalize' to 'FALSE' otherwise you get an error.

unlist

if 'TRUE' returns a single character vector with all output for each each string in 'json' input

finalize

completes the parsing and verifies that the JSON string is valid. Set this to 'TRUE' when feeding the final piece of data.

Examples

1
2
3
4
program <- jqr_new(".[]")
jqr_feed(program, c("[123, 456]", "[77, 88, 99]"))
jqr_feed(program, c("[41, 234]"))
jqr_feed(program, "", finalize = TRUE)

ropensci/jqr documentation built on Oct. 26, 2018, 7:15 p.m.