Connecting to sandbox cluster from the mongo shell

I have trouble connecting to sandbox cluster from the mongo shell. When i run the connection string in the command line, I get an error: [js] Syntax Error: missing; before statement @(shell):1:6

What command you have run
Please check if any spaces invalid characters while cut & paste of commands

and check:

  • may be you already connected to the cluster? if yes you need write: quit() and enter your command

I ran the command: mongo “mongodb://…” and it finally worked. But since this command is long, I could copy but unable to paste it. I had to type it entirelly. What do you think ‘paste’ won’t respond?? Thanks

Hi Jacques,

this site is very helpful:

1 Like

Resolved!. I finally uncovered the problem. I needed to use the file separator ‘forward slash’ character (’/’) for it to work on Windows. Before I was using the backward slash and it frustrated me a lot in the last couple days. The correct command worked the following way:
PRIMARY> load(“C:/Users/your username/M001/loadMovieDetailsDataset/loadMovieDetailsDataset.js”)