如何在MongoDB的外壳中打印出20多个项目(文档)? [英] How to print out more than 20 items (documents) in MongoDB's shell?
本文介绍了如何在MongoDB的外壳中打印出20多个项目(文档)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
db.foo.find().limit(300)
不会这样做.它仍然只打印20个文档.
won't do it. It still prints out only 20 documents.
db.foo.find().toArray()
db.foo.find().forEach(printjson)
都将打印出每个文档的扩展视图,而不是find()
的1行版本:
will both print out very expanded view of each document instead of the 1-line version for find()
:
推荐答案
DBQuery.shellBatchSize = 300
会的.
MongoDB文档-配置mongo Shell-更改mongo Shell批处理大小
这篇关于如何在MongoDB的外壳中打印出20多个项目(文档)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文