Error importing collections into a mongodb database on an ec2 instance

Hello everyone,
I exported the collections from a local database and I want to import them into an ec2 instance.

I did the following:

1) I exported the collections to a folder called data. The files are in this format:

collecion_test.bson

collection.metadata.json

2) I transferred the folder to an ec2 instance. The path to access the folder is like this:

/home/ec2-user/data

3) I went into mongo and did “use database_test” and created a collection like this: db.createCollection(“data”)

Finally, I tried to import the file this way:

mongoimport --db database_test --collection data --file /home/ec2-user/data/data.metadata.json -jsonArray

but I get this error:

2022-02-18T19:29:38.380+0000 E QUERY [js] SyntaxError: missing ; before statement @(shell):1:14

I appreciate if anyone can help me analyze this!

Most likely you are running import command at mongo prompt
Run it from your os prompt($,#,c:\ etc)