MongoDB shell 格式化 直接的方法: db.collection.find().pretty(); 如果想要所有的查询都格式化,可以执行: echo "DBQuery.prototype._prettyShell = true" >> ~/.mongorc.js