Function unnest_ndjson::unnest_to_ndjson
source · [−]pub fn unnest_to_ndjson<R: Read>(
from: R,
to: impl Sinker,
target: usize,
header_style: HeaderStyle
) -> Result<()>
Expand description
Consume a large JSON document from a Read
, and write sub documents to a destination.
The typical destination is just a Write
implementation, like a std::fs::File,
or a Vec. Alternatively, you can use the Sinker interface to get access to fragments
of documents.
Configure the level of un-nesting with the target
parameter. 1
will remove one level
of nesting, such as converting [{"a":5}, {"a":6}]
into {"a":5}
and {"a":6}
.
header_style
controls how much context to retain. See HeaderStyle.