How to import a document to a shared cluster? I am getting SyntaxError:Missing semicolon. (1:14)

I am just starting to explore MongoDB and trying to import some data to a shared hosting, but I am getting SyntaxError: MIssing semicolon. (1:14)

Maybe I am doing it all, all wrong? So, I am gonna tell you all the steps I have done with MongoDB.

First I was using it locally in my computer with Mongo 5.5 and I was able to create and transfer a CSV file from Excel into my local Mongo driver.

But now I want to test it live and just started using the shared free option.

I downloaded “mongosh” as it was telling me it was better to work with “mongosh”

Managed to connect my cluster using mongosh to my hyper terminal.

Now I need to import my csv to my cluster.

I found this from the documents, but it isn’t working:

mongoimport --uri mongodb+srv://elindo:@cluster0.gcyyo.mongodb.net/ --collection --type --file

^^ I am typing the above code in my hyper terminal right after connecting to my cluster. and giving me:
SyntaxError:Missing semicolon. (1:14)

Questions:

Where do I need to put the file to import to my cluster? Right now the file is under the old MongoDB folder … Program files > MongoDB > Server > 5.0 > bin

Should I move the folder somewhere else now that I am using mongosh? I am not sure where the mongosh files went, but I can cehck.

I am putting all my pasword, and other information in between the <> provided in the code.

What exactly am I missing?

You should not run mongoimport after connecting to your cluster.Run the command from your os prompt like $.# etc as per your os

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.