Last Updated: February 25, 2016
· leemachin

Pretty print MongoDB queries in REPL

Make your query more readable when using the REPL by chaining pretty() on to the end of it:


Don't want to do it for every query? Enable it by default!

Just paste this into your terminal (not into the Mongo REPL):

echo "DBQuery.prototype._prettyShell = true" >> ~/.mongorc.js