1

I'm using MongoDB on an Ubuntu server (base server), I am wondering if when i view a collection using db.collection.find().pretty() in the Mongo shell if there is a way I can scroll through - it is a large collection and I need to view it in detail.

Thanks in advance.

Not a duplicate, I am talking about scrolling through a mongo shell output in Ubuntu - not how to print X items.

Hughzi
  • 2,470
  • 1
  • 20
  • 30
  • possible duplicate of [How to print out more than 20 items (documents) in MongoDB's shell?](http://stackoverflow.com/questions/3705517/how-to-print-out-more-than-20-items-documents-in-mongodbs-shell) – Neo-coder Sep 11 '15 at 09:11
  • @Yogesh in what way is it a possible duplicate? – Hughzi Sep 11 '15 at 09:16
  • @Hughzi Well it could be "possible" as the default output is only 25 items and you could ask it for more than that if you wanted. But I'm also sensing this has something to do with using a scroll bar in a terminal window, or other "power user" (sic) type operation. So which reason would you pick to place this "non programming question" on hold? Or maybe it's asking for a "tool or library"? The list goes on. – Blakes Seven Sep 11 '15 at 09:30
  • @BlakesSeven I was wondering basically if there is anything like "less" which will let me scroll in mongo shell? – Hughzi Sep 11 '15 at 09:34
  • 1
    Which is actually a reason why to place the question on hold as you are "asking for tools". The shell is just a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop), which basically means it "evals" and "prints" the results of whatever you type in on a line. So if the functions where "wrapped" with such functionality ( and they are not without an additional tool ) then "less" like behavior could be achived in theory. But for simplicity, A. You can change the number of items to return per cursor batch, Possibly 1 ( suggested duplicate ) or B. Use the scroll bar. – Blakes Seven Sep 11 '15 at 09:41
  • Why are you not able to just scroll backwards in your terminal window? – Bytor Sep 11 '15 at 16:05

1 Answers1

2

If u are using command line to query it , and if your collection has more documents then it says

"type 'it' to view more documents".

Else use any tool like ROBOMONGO to connect to mongo instance to view all documents on scroll.

TharunRaja
  • 707
  • 7
  • 28
  • I was wondering if its possible to scroll from an output in Mongo shell, i can display the right amount of documents – Hughzi Sep 11 '15 at 09:20