On this page本页内容
cursor.
pretty
()¶mongo
Shell Method
This page documents the 本页记录了mongo
shell method, and does not refer to the MongoDB Node.js driver (or any other driver) method. mongo
shell方法,未提及MongoDB Node.js驱动程序(或任何其他驱动程序)方法。For corresponding MongoDB driver API, refer to your specific MongoDB driver documentation instead.有关相应的MongoDB驱动程序API,请参阅特定的MongoDB驱动程序文档。
Configures the cursor to display results in an easy-to-read format.将游标配置为以易于阅读的格式显示结果。
The pretty()
method has the following prototype form:pretty()
方法的原型形式如下:
Consider the following document:考虑以下文件:
By default, 默认情况下,db.collection.find()
returns data in a dense format:db.collection.find()
以密集格式返回数据:
By using 通过使用cursor.pretty()
you can set the cursor to return data in a format that is easier for humans to parse:cursor.pretty()
,可以将游标设置为以更易于人类分析的格式返回数据: