A good rake refresher!
Category: General
How To Leverage The MongoDB Aggregation Operators To Gain Advantages
Siva talks about the MongoDB Aggregation operators and how to use them to get the maximum benefits. Good code samples help us understand complex use-cases!
Most programmers who use MongoDB may have heard about its aggregation framework but only a few have used it to its full potential. Recently, in one of our projects, we got a complex requirement where the user needed to generate a report of sales done for any day, month or year. Using just MongoDB queries would have been very slow compared to the aggregation framework. So I decided to take up the challenge and learn the aggregation operators and make my code awesome! Here are the operators that helped me:
1. $and
$and is one of the MongoDB aggregation conditional operators where you can specify multiple conditions. Any document which satisfies all these conditions would get forwarded to next stage in the pipeline which is nothing but $group stage. Here is an example
The above example returns the $agreement_amount if it is today’s booking.
Similar to…
View original post 200 more words
CodeCuriosity: A New Beginning Of The Curious Coder
Sometimes what starts as an experiment becomes something much bigger. That's exactly what happened with CodeCuriosity. For the past few years, we have always encouraged people at Josh to do open-source contributions. This helps everyone: * It helps you build your public profile and showcase your strengths. * You learn new techniques and coding practices … Continue reading CodeCuriosity: A New Beginning Of The Curious Coder
