Is there a shell one-liner to convert JSON to BSON?
Converting JSON to BSON
There's this C implementation that includes a Makefile
called json2bson.c
.
Converting BSON to JSON
The MongoDB project provides a tool called bsondump
.
The bsondump converts BSON files into human-readable formats, including JSON. For example, bsondump is useful for reading the output files generated by mongodump.
Usage
$ bsondump collection.bson > collection.json
There's also this Ruby script I found called bson2json.rb
to convert BSON to JSON as well.