默认情况下,在MongoDB Shell中漂亮打印 [英] Pretty print in MongoDB shell as default

查看:47
本文介绍了默认情况下,在MongoDB Shell中漂亮打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法告诉Mongo漂亮的打印输出?当前,所有内容都输出到一行,并且很难读取,尤其是对于嵌套的数组和文档.

Is there a way to tell Mongo to pretty print output? Currently, everything is output to a single line and it's difficult to read, especially with nested arrays and documents.

推荐答案

(注意:这是该问题的原始版本的答案,该版本对默认"没有要求)

你可以要求它漂亮.

db.collection.find().pretty()

这篇关于默认情况下,在MongoDB Shell中漂亮打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆