[MongoDB] Display Count in mongo shell Can Be Set with DBQuery.shellBatchSize
Tadashi Shigeoka · Fri, October 24, 2014
The default display count in mongo shell is 20 items, but to change this, you can modify the value of DBQuery.shellBatchSize.
// If you want to set the display count to 500 items
DBQuery.shellBatchSize = 500;
When you know in advance how many results a query will return, setting that count allows you to output all results at once, which is convenient because you don’t need to type “it”.
db.users.find()
...
Type "it" for more
// Normally you'd have to type "it" every 20 items
That’s all.
Reference Information
- How to print out more than 20 items (documents) in MongoDB's shell? - Stack Overflow
- The mongo Shell — MongoDB Manual 3.4
That’s all from the Gemba.
