Hi, about the function "pretty()"

I don’t know what makes the function “pretty ()”?
e.g. (db.movies.find ({mpaaRating: “PG-13”}). pretty ()

Hey @Mauro_13055

From the docs; it is a method on the cursor object (which is what gets returned from queries) to make the output easy to read.

.pretty()

Configures the cursor to display results in an easy-to-read format.
The pretty() method has the following prototype form:

db.collection.find(<query>).pretty() 
1 Like