[SERVER-1071] Add pretty() feature to find() Created: 01/May/10 Updated: 12/Jul/16 Resolved: 03/May/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | 1.5.2 |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Greg Zoller | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Getting a pretty rendering of json is fairly common (to me anyway) in the shell. Today I need to do something like: db.foo.find().forEach(function ); Wow... that's a lot of typing. Would it be simple thing to define a macro for the above code so that you could do something like: db.foo.find().pretty() |
| Comments |
| Comment by Greg Zoller [ 22/Apr/11 ] |
|
I've been so happy using this cool feature I just noticed that I couldn't find it in the docs. Should probably be described in the mongo shell docs, at a minimum in the reference. |
| Comment by auto [ 03/May/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: pretty() option for cursor in shell |
| Comment by Eliot Horowitz (Inactive) [ 03/May/10 ] |
|
> db.foo.find() { "_id" : ObjectId("4bdf157067103eab207b86f5"), "a" : 1, "b" : 2, "c" : 3, "d" : 4, "e" : 5, "f" : 6 }> db.foo.find().pretty() |