M121-Lab-$Match

Hi All,
I am unable to load the collection validateLab1.js from command line, i am using this command
load(‘Mypath\validateLab1.js’) but this error appear, file does not exits.

Regards,
Muzaffar

@ Muzaffar_ali_53011

What OS and version are you using, and where in your path is the script? Note that “Mypath” isn’t normally an actual path variable, but a stand-in for your path.

I’m at a loss. I’m trying to import a json file to the server prescribed in the earlier lectures using this command from the command line.
mongoimport --host cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl -u m121 -p “aggregations” --norc --db test --collection aggs --file .\m121_Handouts\match_stage.js
I haven’t found the json just yet, but I’m trying first to get any json file uploaded. I’m getting the message that no collection is specified.
Or, are we supposed to upload to a local Mongo instance?

I got an error while running validateLab1(pipeline) in Lab
2019-02-16T10:51:11.353+0530 E QUERY [js] ReferenceError: pipeline is not defined :
@(shell):1:1

Did you define your variable
EnterprisePrompt> var pipeline=[…]
I was able to load my .js file when copying it into the directory from which I activate the Mongo shell. Who’d have thought? Just need to get my agg query correct. Have only 5 docs presenting.

TO ALL:

Please, please DO NOT tack new and different questions onto the someone else’s post. Notice here I have three students, each with a different problem and each requesting help. I can’t really help everyone if you just jumble up your questions. Please create a new post for a new question. Help me help you!! Thanks.