I want to deploy a Flask App containing a MongoDB database to Heroku. In some tutorials, it was said to use mLab MongoDB, but I cannot see that add-on in heroku. Can someone suggest how I can deploy the database to Heroku?
The add-on has been discontinued some time ago by Heroku.
A good alternative is to use Atlas which offers a free tier and can be easily integrated with Python using pymongo
# obtain connect string from Atlas
connect_string = 'mongodb+srv://user:pwd@mycluster-ubiho.azure.mongodb.net/mydb?retryWrites=true&w=majority'
client = MongoClient(connect_string)
db = client.get_default_database()
# query users collection
db.users.find_one({"user":"beppe"})
See also this Medium blog post "1, 2, 3: Docker, Heroku, MongoDB Atlas, Python"