How to print out more than 20 items (documents) in MongoDB's shell?
2016-09-27 16:57
330 查看
How
to print out more than 20 items (documents) in MongoDB's shell?
won't do it. It still prints out only 20 documents.
will both print out very expanded view of each document instead of the 1-line version for
Could always do:
To get that compact view.
Also, I find it very useful to limit the fields returned by the find so:
which would return only the _id and name field from foo.
to print out more than 20 items (documents) in MongoDB's shell?
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():
Could always do:
db.foo.find().forEach(function(f){print(tojson(f, '', true));});
To get that compact view.
Also, I find it very useful to limit the fields returned by the find so:
db.foo.find({},{name:1}).forEach(function(f){print(tojson(f, '', true));});
which would return only the _id and name field from foo.
相关文章推荐
- 如何在vim中注释掉多行(how to comment out more than one lines in vim)
- 如何在vim中注释掉多行(how to comment out more than one lines in vim)
- how to run 2 or more commands in a shell script [for Linux & Windows]
- solr或lucene中出现there are more terms than documents in field "name", but it's impossible to sort on tokenized fields异常
- How to make gdb print out all values in hexadecimal mode?
- How To Be More Interesting (In 10 Simple Steps)
- How To Sort Items in a CListCtrl in Report View
- MVVM :How to select multiple items in listbox
- How to pass in/out return VB Byte array from a COM Component written in C#
- 学习:How To Use Filters in SharePoint to show items in the current Calendar Month(转)
- How to choose the right data structure in different scenarios to bring out best performance?
- There Is More To Sydney Than Fun In The Sun law
- (原創) 如何解決『Error: More than one programming cable found in available hardware list --use--list option to display available hardware list and specify correct cableprogramming』錯誤訊息? (SOC) (Nios II) (μClinux) (DE2) (DE2-70)
- How to validate Xml Documents against schemas in BizTalk
- how to zoom in/out in mac
- How to get a job paying more than $100,000 a year
- [Javascript] A function works like 'print_r()' in PHP to print out the details of an object for JS debugging
- Axure RP Pro - jQuery - How to implement fade in and fade out effects
- solution to hibernate in windows server 2003 sp1 with more than 1G memory
- How to print property if declaring in the format of @synthesize a=_a;