LAB 1 people.json failed to import

Hi just started M201. Installed mongodb 3.4.x, so far so good.
Tried to mongoimport people.json and it failed.
"
Thu Nov 15 04:23:48.582 User Assertion: 13293:BSON representation of supplied JSON array is too large: code FailedToParse: FailedToParse: Date expecting integer milliseconds: offset:366
Thu Nov 15 04:23:48.582 exception:BSON representation of supplied JSON array is too large: code FailedToParse: FailedToParse: Date expecting integer milliseconds: offset:366
"
I created a new json file with only the first document of people.json and got the same error.

The download really did not work as a ‘download’ when clicking on the json link actually it opens the whole json file on the browser and from there I just saved it.

Did anybody encounter the same error?

I’ve had spotty results downloading some of the larger json files. You could retry the download, this time using curl or wget to directly write the file to disk.

It’s an odd error though, isn’t it? :slight_smile:

It worked fine for me but I am running 3.6.3.

My first line of people.json looks like:
{"_id":{"$oid":“57d7a121fa937f710a7d486e”} … {"$date":“2011-03-17T11:21:36.000Z”},“email”:“murillobrian@cox.net”}

Do you have the same?

Hi Tess!
I was wondering if ther is an issue with the download/conversion from windows to Linux. Actually there is no download link, or I could not find it. It says download ’ here’ but the here opens the doc in a browser, I just saved it to a file from there.
Now, I saved the file to a directory I am sharing using Vagrant… It worked fine on all other labs.

Hi steevej! Yup, that is the file. But something is wrong with mine.

Ooooohhhh good point!!

Try running:

dos2unix people.json

If that command isn’t found, first install it with:

sudo apt install dos2unix

Thanks guys … it went downhill from there … if I tried to install dos2json it will conflict with the MongoDb server and will asked to uninstall it … anyway. Yeah there options on apt install, but really I did not feel like learning something else in prder to keep learning, if you know what I mean.

So, forget about the fancy containers and Vagrant and Ubuntu. I installed mongoDB on windows, the json file ran with no issues :slight_smile: I guess I will proceed with this course on Windows.

Thanks for all the answers!

1 Like

@ eacardu

Just FYI, the way to download a file like ‘people.json’ is to right-click on the link in the browser, and use the drop-down menu – in Chrome, this is “Save link as…” and there are similar options for all other browsers that I know of. That allows you to save the file onto your system.

I certainly sympathize with your desire not to have to learn a lot of new stuff just to complete the course, and my memory is that you should be fine just doing the work on your own system. Good luck.

2 Likes

open the html and copy paste in note pad and save the file in the name people.josn