Search code examples
mongodbzshosx-yosemitepretty-printoh-my-zsh

pretty print in mongo shell not working - MongoDB 2.6 + Yosemite + ZSH


I'm running the mongo shell by invoking mongo at the command line. The result is a bland shell experience. I would like to see colored JSON output, etc. I tried running:

> db.my_collection.find().pretty()

but it didn't work.

I also tried adding the following line to ~/.mongorc.js:

DBQuery.prototype._prettyShell=true

but it didn't work.


Solution

  • Try the MongoDB shell enhancement. You can make particular tweaks after you clone the repo.