0

When you query something in mongo using db.collection.find() and if the result set exceeds the max allowed shellBatchSize, mongo prints n number of records and says type "it" for more. If oyu don;t want to see more, How to get out of this and get back to mongo shell?

I know CTRL +C I know converting the output to a JASON Array I know diverting the output to a file.

I'm looking for some non-crude way (like CNTRL + C) to get back to mongo shell.

Thanks,

Vamsi
  • 52
  • 10
  • 1
    You're already back at the mongo shell prompt when it does that. – JohnnyHK Feb 15 '17 at 19:21
  • hmm.. interesting. But how can i run another query at the prompt without crudely getting out of mongo shell completely and coming back by: `>mongo > use db` etc.. – Vamsi Feb 15 '17 at 19:26
  • 2
    Just type a new command at the `>` prompt. Maybe you're seeing something else? – JohnnyHK Feb 15 '17 at 19:27
  • let me try that...please ignore my reply. – Vamsi Feb 15 '17 at 19:27
  • OMG it is correct. Never realized that. I feel so ignorant. Sorry for a stupid question and many thanks for the reply. – Vamsi Feb 15 '17 at 19:29

1 Answers1

2

When you execute a query in the shell that results in Type "it" for more, you're already back at the main command prompt of the shell. You can just type a new command at the > prompt.

JohnnyHK
  • 305,182
  • 66
  • 621
  • 471