Updating Embedded Documents in Mongoid

I faced a situation in my project where I need to update all the embedded documents. But as we generally know about the mongoid embedded documents we can’t access directly, we must access them through parent documents. I have millions of such parent documents and they embed many child documents. So in the general solution, … Continue reading Updating Embedded Documents in Mongoid

A Simple Go Web App on Heroku with MongoDB on MongoHQ

Go is an extremely clean and fun language to work with and has a bunch of handy, modular, well documented packages out of the box. We can easily build a small web app using pure Go for handler functions, the net/http library for routing and serving and mgo as a MongoDB driver. The simple Go … Continue reading A Simple Go Web App on Heroku with MongoDB on MongoHQ

Mongoid and the MongoDB Aggregation Framework

MongoDB introduced the aggregation framework since Version 2.2 but the power of the aggregation framework has only been tapped in Mongoid only since 3.1.0. Even today in the latest version (currently v4.0.0), the aggregation framework is used only for some basic functionality - :sum, :count, :avg, :min and :max. While this is much better than running … Continue reading Mongoid and the MongoDB Aggregation Framework