I dropped the Inspections collection in M001 by mistake

Hello everyone,

I dropped the inspections collection in the database in the M001 course by mistake. Now I need it for some exercises. Is there a way for me to get it back?

Thank you

Check this link

Missing the inspections collection

Thank you. But now I’ve been trying to import the file into my database but I don’t seem to get it. Can you also help with that?

What command you ran and what error are you getting?

Try something like below.Make appropriate changes as needed
mongoimport --uri mongodb+srv://m001-student:@sandbox.xyz.mongodb.net/sample_training --collection inspections --type JSON --file /Users/user_name/Downloads/inspections.json
Replace xyz with your cluster

this right here is the link to the file in my local disk right?

because I keep getting an error that file can’t be found meanwhile, the file path is correct.

Are you trying on Windows box or IDE or Unix box?
Are you giving absolute path or relative path
Try to use quotes if it is on Windows cmd prompt

–file “C://myDataset.json”

or cd to the directory file is residing and run the mongoimport command without giving any path for file

You can do it in several ways.Try different ways

I’m using the IDE

Can I use the IDE space provided by the course to add the file also?

When i mentioned several ways i meant about mongoimport options
I don’t think you can use IDE to load it
You have to do it from your local host
What error are you gettting? still not able to identify the file even if you cd to the dir where file is residing?
What is your OS? Windows or Unix?

Best thing is to drop sample_data and reload the data into your cluster from Atlas
If this does not work drop your cluster itself create new one and try to load sample_date

I’m using a Windows

Please show the screenshots of the command you used and errors

I was able to load a .json file from my laptop(Windows) to my Sandbox cluster with command i gave above
Did you try --file as below

–file “C:\Users\xyzt\Downloads/somefile.json”

or cd to the dir and use below

–file somefile.json

1 Like

I was able to solve it at this time. I dropped the former cluster and created a new one

Hi @Sleek_Trends,

You can’t use the IDE space to load it because this dataset is not present there. As @Ramachandra_37567 mentioned, you would need to do it from your local machine.

I’m glad your issue got resolved. Let us know if you have any other questions.

~ Shubham