如何在MongoDB的shell中打印出20多个项目(文档)? [英] How to print out more than 20 items (documents) in MongoDB's shell?
本文介绍了如何在MongoDB的shell中打印出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的shell中打印出20多个项目(文档)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文