Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy and paste text in MongoDB shell

How to copy and paste text in MongoDB shell?

I tried Ctrl+C and Ctrl+V but it didn't work.

Thanks, Michael.

like image 836
Michael Horojanski Avatar asked Apr 03 '17 07:04

Michael Horojanski


2 Answers

If you are using Windows then Command:

Copy = Ctrl + Insert
Paste = Shift + Insert

This works for Windows as well as Linux:

1. Select your text using Mouse
2. Press Mouse-Right button to Copy & Paste
3. Press Mouse-Right button to Paste copied text from Clipboard
like image 199
csharpbd Avatar answered Oct 20 '22 23:10

csharpbd


This is what I did:

I ran mongo shell on the command line to have access to my databases. I wanted to add some data to a collection. I wrote the code in a text editor. Then I tried to use CTRL+C and CTRL+V but mongo shell did not accept it.

So instead I RIGHT CLICKED on the command line TAB, CLICKED on EDIT, then CLICKED on PASTE.

I hope this helps.

Please see image gif here

gif

like image 38
Walter Clayton Avatar answered Oct 20 '22 23:10

Walter Clayton