Hi,
I tried to load people.json file on my cluster and it is failing with below error:
MongoDB Enterprise Cluster0-shard-0:PRIMARY> load(“people.json”)
2019-03-18T23:18:33.415-0500 E QUERY [js] [people.json:1:6] SyntaxError: missing ; before statement
Stack trace:
@(shell):1:1
2019-03-18T23:18:33.426-0500 E QUERY [js] Error: error loading js file: people.json @(shell):1:1
I edited people.json file by adding below 3 lines on the top of file:
db = db.getSiblingDB(“m201”);
db.people.drop();
db.people.insertMany ( [
and added below line at the end
] ) ;
This time load command failed with below error message:
MongoDB Enterprise Cluster0-shard-0:PRIMARY> load(“people.json”)
2019-03-18T23:19:05.585-0500 E QUERY [js] [people.json:5:0] SyntaxError: missing ] after element list
Stack trace:
@(shell):1:1
2019-03-18T23:19:05.594-0500 E QUERY [js] Error: error loading js file: people.json @(shell):1:1
What is the mistake I am doing here ?
Thanks,
Prashant.