I have been learning Ruby on Rails lately and was using Heroku as a free production environment for learning. I got to the point I wanted to add MongoDB to my setup. I chose Mongoid 5 (the latest version right now) and MongoLab - which offers a free plan on Heroku.
I got stumped configuring mongoid.yml because most of the answers I found on stackoverflow are outdated - talking about version 4, 3 or even 2.
So after I found a solution that works, I decided to post it here, mostly as a way of documenting it. If you have a better way to configure mongoid.yml to work with MongoLab on Heroku, it will be more than welcome.
Thanks.