Subscribe to my newsletter and never miss my upcoming articles
✏ MongoDB Aggregation: $sort, $count, $limit, $out stages Today I'm wrapping up my short series about the Mongo aggregation framework, to cover a few additional stages that are often used at the end of the pipeline. Most are quite straightforward and...
✏ MongoDB Aggregation: $unwind stage The $unwind stage is meant to handle fields that have arrays as values. It often comes before the $group stage, and it'll finally solve the problem I had with my recipe database - the reason why I started looking ...
✏ MongoDB Aggregation: $project stage This stage takes a collection of documents, and projects each document on a (usually) smaller document. You can include/exclude, rename and restructure fields in this stage. Typically, this stage comes after $mat...
✏ MongoDB Aggregation: $group stage With $group, you can completely restructure the collection, depending on different criteria of your choice. This stage makes the most sense when using it together with accumulators (see below), but I'll start with ...
✏ MongoDB Aggregation: $match stage The $match stage is basically the same as using .find({ condition }). Using $match on its own doesn't perform any aggregation yet, it's only the first step, to select a subset of documents in a collection. Below is...
✏ Advanced MongoDB: Aggregation Dealing with databases is a very common task for full stack developers. Depending on what you're building, it's likely that at some point, your application will have to interact with a database - to handle user logins,...