Skip to content

Commit

Permalink
doc: update large file example to show stream mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
kitplummer committed Apr 28, 2020
1 parent fb96b42 commit fc2aa00
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 fc2aa00

Please sign in to comment.