0 votes
1 view
in SQL by (47.8k points)

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.

2 Answers

0 votes
by (107k points)

You can use the pretty() function for pretty print in MongoDB shell as default see the code below:-

db.collection.find().pretty()

0 votes
by (78.7k points)

In MongoDB, a function exists known as pretty function. It will display all the documents in separate lines, refer to the following screenshot:

image

Here 'operate' is my collection name.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Sep 13, 2019 in SQL by Sammy (47.8k points)
0 votes
2 answers
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...