Tuesday, October 6, 2015
Pretty print in MongoDB
The bare minimum: pretty
Use JS'spretty
function to prettify your JSON documents or collections within the Mongo's shell: db.find({}).pretty()Here's the difference with a simple example:
You can even turn it as your default in your preference file
~/.mongorc.js
using this command: echo "DBQuery.prototype._prettyShell = true" >> ~/.mongorc.js
Thanks to Lee Machin for this tip: https://coderwall.com/p/3vfw9a
The cleanest one: Mongo-Hacker
Mongo-Hacker adds much more than a simple prettification: it adds colors and some additional API. Installing it with the following commands:npm -g install mongo-hackerNow, here is the same example with some nice hacking:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment