1

been working with mongo recently, which means a ton of very large nested hashes in (basically) json format. Currently I am piping json through python -mjson.tool in emacs, which works great for json, but bson also includes ObjectId("key"), and ISODate("date") (for example, {"_id": ObjectId("4ec319b0e35c1f1063000015"), "date": ISODate("2011-11-16T00:00:00Z")} which are not valid json, and causes the python lib to puke.

Does anyone know of a more lenient prettifier? Or some other way to accomplish the job for BSON. I don't even mind if the solution drops the wrapping functions, it is more to be able to visualize a deeply nested json datastructure easier

Matt Briggs
  • 41,224
  • 16
  • 95
  • 126
  • have you found a solution for your problem ? – ascobol Mar 05 '12 at 15:14
  • 1
    @ascobol: not really. my issue was with mongo output, but I discovered chaining .pretty() at the end of my results would prettify them in the shell. Would definately still like an answer – Matt Briggs Mar 05 '12 at 18:40
  • possible duplicate of [BASH BSON parser](http://stackoverflow.com/questions/12318086/bash-bson-parser) – Paul Sweatte Feb 06 '14 at 02:32

0 Answers0