Question

I've added the line to my .mongorc.js:

var EDITOR = "C:\\Windows\\notepad.exe";

When I run edit q from mongo shell it opens notepad with the following content:

screenshot of notepad

Same thing happens with vim. The editing works just OK, i.e. if I remove the line and write what I need, it's passed to shell properly.

Any ideas on how to get rid of that line?

Was it helpful?

Solution

As for the undefined part, the reason is that you have no content in what you are trying to edit.

If you follow the section as described in the FAQ:

Define a function myFunction

function myFunction() {}

Then edit with your editor:

edit myFunction

Everything will work as expected. So the problem was your q thingy was not defined, hence the output.

The other characters are likely a system code page issue. I'm not sure if interaction with the shell expects ANSI or whether UTF-8 is okay. But anything else or UTF-16 might cause the issue. Hard to tell without knowing what language setting you have, etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top