Skip to content

Commit

Permalink
Merge pull request #19 from kitplummer/feat/value-streamer
Browse files Browse the repository at this point in the history
doc: update large file example to show stream mapping
  • Loading branch information
boudra committed May 7, 2020
2 parents fb96b42 + fc2aa00 commit bc0e26e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ Query a large file without holding the whole file in memory:
"large_file.json"
|> File.stream!()
|> Jaxon.Stream.from_enumerable()
|> Jaxon.Stream.query([:root, "users", :all, "id"])
|> Enum.to_list()
|> Jaxon.Stream.query([:root, "users", :all, "metadata"])
|> Stream.map(&(&1["username"],",",&1["email"],"\n"))
|> Stream.into(File.stream!("large_file.csv"))
|> Stream.run()
```

## How does Jaxon work?
Expand Down

0 comments on commit bc0e26e

Please sign in to comment.