cursor.pretty()
On this page
Definition
-
cursor.
pretty
( ) -
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: