insertMany("insertMany-ordered.js") Syntax error

How do I resolve this syntax error:

MongoDB Enterprise Sandbox-shard-0:PRIMARY> db.moviesScratch.insertMany(“insertMany-ordered.js”)
2019-03-25T12:04:58.929-0700 E QUERY [js] SyntaxError: illegal character @(shell):1:28 MongoDB Enterprise Sandbox-shard-0:PRIMARY>

Use load method

MongoDB Enterprise Cluster0-shard-0:PRIMARY> load(“insertMany-unordered.js”)
Make sure you are enclosing the file with double quotes

1 Like

And Be sure that the insertMany-ordered.js in the same path on your machine!

1 Like