- Reference >
mongo
Shell Methods >- Cursor Methods >
- cursor.pretty()
cursor.pretty()¶
On this page
Definition¶
-
cursor.
pretty
()¶ mongo
Shell MethodThis page documents the
mongo
shell method, and does not refer to the MongoDB Node.js driver (or any other driver) method. For corresponding MongoDB driver API, refer to your specific MongoDB driver documentation instead.Configures the cursor to display results in an easy-to-read format.
The
pretty()
method has the following prototype form:
Examples¶
Consider the following document:
By default, db.collection.find()
returns data in a dense format:
By using cursor.pretty()
you can set the cursor to return data in a
format that is easier for humans to parse: