Trouble loading sample data in MongoCLI 5.0

Hello,

I’ve upgraded my local MongoDB environment to 5.0 and I guess I’m not familiar with this generations commands.

I was getting some errors in my MongoDB M001 MongoDB basics. So I decided to drop the databases and import the data again. I wiped out my Mongo 4.0 cli when I upgraded to 5.0.

I’m trying to upload the data into my own Atlas environment.

The command I found in the docs to do this under 5.0 was this:

mongocli atlas clusters loadSampleData m001-student:secret@sandbox.gs9m7

Then I get an Error: missing credentials error. Then it tells me to: To set credentials, run: mongocli config

So now I try to enter in my Atlas cluster credentials with:

mongocli config
You are configuring a profile for mongocli.

All values are optional and you can use environment variables (MCLI_*) instead.

Enter [?] on any option to get help.

? Public API Key: [? for help] m001-student

? Public API Key: m001-student
? Private API Key: [? for help] *******************
there was a problem fetching orgs: GET https://cloud.mongodb.com/api/atlas/v1.0/orgs: 401 (request "") You are not authorized for this resource.
? Default Org ID: [? for help] MDBU

X Sorry, your reply was invalid: the provided value 'MDBU' is not a valid Id

I don’t really know what I’m doing wrong. All I want to do is load the sample data back into my Atlas cluster like I’d had it before. Since my upgrade I no longer have access to mongorestore or mongoimport.

I’d appreciate any help to get me past this point!

Can you elaborate on the above?

I do not recall having to use mongocli for M001 as you are supposed to use the browser IDE supplied in the course material.

Yes, I was using the mongo cli with my atlas cluster for the mongodb course just fine until I upgraded to the 5.0 cli. The 4.0 cli was working fine, and I preferred to use my own local cli to do the lessons instead of the browser in the IDE.

I was doing a question in chapter 4 that asked:

How many businesses in the sample_training.inspections dataset have the inspection result "Out of Business" and belong to the "Home Improvement Contractor - 100" sector?

And my total was off. I thought something had changed in the DB when I was running through the lessons.

So I decided to drop the database and reload the data. But since I’ve upgraded to the new version of the CLI I can’t get the data back into my Atlas cluster. So even if I use the the browser IDE supplied in the course material the data wouldn’t be there.

How can I load the sample data back into the cluster using MongoDB CLI version 5?

I don’t know how to do it with the cli, but for Atlas there is a menu item somewhere that says Load Sample Dataset. The first few lessons of the course shows how to do it.

Yes, and that’s how I did it before. But that was with the 4.0 CLI. I don’t know how to do this with the 5.0 CLI, that is my current problem. I would rather not downgrade to do this if at all possible.

Oh sorry there’s a load sample data button in the Atlas interface. That must’ve been how I’ve done it before only I’d forgotten. It still would be cool to know how this is done in the 5.0 CLI if possible. I had no trouble loading data into MongoDB (local or Atlas) using the CLI under 4.0. But I have yet to get the hang of this under the 5.0 CLI.

Thanks