Query shows wrong result with your dataset

M001_CHAPTER_4_PROBLEM_1

My answer
MongoDB Enterprise atlas-da8ut0-shard-0:PRIMARY> db.zips.find({“pop”:{$lt:1000}}).count()
8062

after getting my answer wrong, i checked the answer, the count shows 8065 in the learning portal
but then i tried the same code as mentioned but i get 8062

MongoDB Enterprise atlas-da8ut0-shard-0:PRIMARY> db.zips.find({ “pop”: { “$lt”: 1000 }}).count()
8062
please check this out

Hi,

that happens when the collection was modified since it was first loaded.

Options

  1. copy paste this json file https://media.mongodb.org/zips.json
  2. remove and reload datasets using Atlas.
  3. or clone whole repo from github GitHub - ozlerhakan/mongodb-json-files: A curated list of JSON / BSON datasets from the web in order to practice / use in MongoDB

Quickest option is 1. the others involve a lot of crap being downloaded. Any of them should work.

The most secure method, if you’re concerned, is to remove all databases and reload after a few minutes (from Atlas)

1 Like

Loved to hear from you but got a 'Failed" grade due to this :sweat_smile:

Anyway thanks :slight_smile:

1 Like

Don’t worry at all, the only real test is about 150usd$ and is after the courses, in case you need a real certificate. ( I too failed at some ex in M001. Didn’t hurt. )

It’s a good experiment to try to use mongoimport, and solve it even though you can’t get the highest score.

To copy the json data go to raw, and press CTRL + a on ffox at least.

Have a good day.

1 Like

thanks again :slight_smile:

1 Like