[SERVER-4371] pretty print when find returns one result Created: 24/Nov/11 Updated: 29/Feb/12 Resolved: 25/Nov/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Grégoire Seux | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | shell | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
It would be nice to have a more pretty print version of find results when there are only a few of them. Instead of inlining results, it could look like findOne output. I understand that some would like to keep this inlining so it should be optionnal (in .mongorc.js ?) |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 25/Nov/11 ] | |||||||||||||||||||||||
|
Yeah, I will add docs for that when you do: db.coll.find().help() | |||||||||||||||||||||||
| Comment by Grégoire Seux [ 25/Nov/11 ] | |||||||||||||||||||||||
|
I think the use of | |||||||||||||||||||||||
| Comment by Scott Hernandez (Inactive) [ 24/Nov/11 ] | |||||||||||||||||||||||
|
You can get the results you want using the printjson function, and converting the cursor to an array:
|