Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

db.foo.find().limit(300)

won't do it. It still prints out only 20 documents.

db.foo.find().toArray() 

db.foo.find().forEach(printjson)

will both print out very expanded view of each document instead of the 1-line version for find():

1 Answer

0 votes
by (106k points)

To print out more than 20 items (documents) in MongoDB's shell you can use the following code:-

DBQuery.shellBatchSize = 300

Related questions

Browse Categories

...