How to print out more than 20 items (documents) in MongoDB's shell?
Asked 07 September, 2021
Viewed 3.1K times
  • 57
Votes
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():

7 Answer