Reputation:
When I run this query, the mongo shell doesn't return all the documents that are in the database collection:
db.collection.find().pretty()
Only a fraction of the actual content is shown. When I head over to the MongoDB Compass GUI, the data is there.
Upvotes: 1
Views: 1337
Reputation: 21
DBQuery.shellBatchSize = [maxnumber you need]
DBQuery.shellBatchSize = 300
Upvotes: 0
Reputation: 14412
Notice that at the very end of the output there's the following line:
Type "it" for more
As suggested, typing "it" and hitting enter fetches more records from the query. Repeat until it says "no cursor". See also Change the mongo Shell Batch Size.
Upvotes: 2