I want to ask the question How do I drop a MongoDB database using PyMongo?
However, StackOverflow already contains an answer to my question but on a question with a markedly different wording than what I've been searching for.
The question is: How to delete pymongo.Database.Database object
From the title of the question it's looks to be asking a different question than my own (and it kind of is), and it's not at all clear that it actually has the answer I'm looking for.
Therefore, I would like to ask my own question so that later solution-seekers will find what they're looking for faster than me.
Backstory
I was looking for a way to drop a MongoDB database with PyMongo, and naturally I searched Google, getting the following five top results:
- drop a database or collection via pymongo · GitHub (outdated: Only works in PyMongo < 3)
- Remove Data with PyMongo — Getting Started With ... (doesn't contain solution)
- database – Database level operations — PyMongo 3.2.1 ... (doesn't contain solution)
- python - How to delete pymongo.Database.Database object ... (StackOverflow link, contains solution)
- How to drop a MongoDB using pymongo - Quora (top answer is outdated, but second answer contains solution)
The problem here is that I never clicked the StackOverflow link as it seems to be asking a different question than the problem I'm trying to solve.
Note: While making this question I actually found a question asking basically the same thing I'm asking here on meta, worded differently. But I didn't find it in my immediate search, leading me to the exact problem I was having to begin with (searchability of questions).