AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
How to Write a Mongo Aggregation Pipeline
MongoDB is a little bit different, you have to like duck out to aggregations. And like writing aggregations is really, really tricky. So I much prefer when like, like for example, I have customers and I have users or like the Mongo pipe aggregation pipeline. It's named a bit funny because I named them before I had the users in the database and I've never wanted to switch it. The way in which you do a relational query using Prisma or any of these other ORMs is as simple as like include this field. That's the entire relation query.