Usually I connect to a database in Pymongo like this:
# connect to the MongoDB
connection = MongoClient("mongodb://127.0.0.1:27017")
# connect to the database
self.db = self.connection.my_database
The problem is, the name of my_database always changes. How can I use a variable to choose the database?