Chapter 3: Quiz 2 - Deleting Documents! May Need Correction!

Hi Friends,

The below question seems to be a little confusing as I have verified the same from the Mongo Shell and in Atlas as well.

image

As the question says: Which of the following commands will delete a collection named villains?

I think the only possible answer w.r.t. the options provided was: db.villains.drop()

Because db.villains.deleteMany({}) is not dropping the entire collection, but all documents within that collection.

Please correct me if I’m wrong or kindly rephrase the question/options so that it won’t confuse new students.

Regards,
Santhosh John.

3 Likes

You are right. In particular importance is deleteMany will keep all the indexes. At the button left of the course-ware you are able to Report an issue.

Excellent points @nimpossible and @steevej-1495

Thank you for bringing it up. Fixing it right now :slight_smile:

5 Likes

It looks like the course-ware has not been updated yet. Good to know this is a known issue with the course-ware. Bad to know my first (should-have-been-correct) attempt was marked wrong, and used up my attempts trying to figure what I was missing.

Hi @Pete_Hogan,

The changes are in the pipeline and very soon we will publish it to production.

That being said, I can see your first response was correct so I have given you credits for this graded quiz.

Hope it helps!

Let us know if you have any other feedback / concerns.

~ Shubham

1 Like