Why can't be pasted a Mongo command into a Mongo prompt in a console window by using Ctrl+V or Ctrl+Shift+V?

Viewed 70

I want to copy and paste the below Mongo command into a Mongo command prompt in a Windows console window. However, it gives no response when I try to use Ctrl+V or Ctrl+Shift+V to paste the command.

Here is my Mongo command:

db.newsList.insert({'headline':'Jason Day signs with Bridgestone Golf', 'content':' Twelve-time PGA TOUR winner Jason Day has signed with Bridgestone Golf to use its golf ball.', 'time':new Date(), 'comments':[{ 'userID': ObjectId("507f1f77bcf86cd799439011"), 'time':ISODate("2022-03-02T22:31:55Z"), 'comment': 'Fantistic!'}]})

Screen shot of the Windows console window with the Mongo command prompt

What I expect to happen is a successful paste of the command to run on Mongo command prompt.

1 Answers

You can't use CTRL+SHIFT+C/V by default in command prompt.

To enable this option:

  1. Right click anywhere inside command prompt.
  2. From there, go to Properties.
  3. In Options tab, there is a 'Use CTRL + SHIFT + C/V as Copy/Paste', you should check it and then click 'OK'.
Related