Back
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.
You can use the pretty() function for pretty print in MongoDB shell as default see the code below:-
db.collection.find().pretty()
In MongoDB, a function exists known as pretty function. It will display all the documents in separate lines, refer to the following screenshot:
Here 'operate' is my collection name.
31k questions
32.8k answers
501 comments
693 users