2

I have a query that takes 3 lines. In the mongo shell, I can type it out so it is on one line, but if I paste it, it goes to 3 lines, and that breaks the syntax.

The same thing happens when I am writing a JavaScript Shell script to execute some mongo queries.

Is there any way around this issue?

Thanks!

Genadinik
  • 18,153
  • 63
  • 185
  • 284
  • did you copy/paste from a terminal, and are the line breaks appearing where the right margin of the terminal is? Very likely. Try pasting into an oversized notepad window (or other gui editor) and see if the text is all one long line or not. If not, you should be able to edit in notepad into 1 long line, then copy/paste that into Mongo. Good luck. – shellter Jun 05 '12 at 18:43

1 Answers1

0

It sounds like you are using an early version 2 which had some multiline-line issues. I think what you are doing should work. Try upgrading Mongo if you can.

lecstor
  • 5,619
  • 21
  • 27