Browsed by
Tag: NoSQL

Aggregation operations – MongoDB queries to the next level

Aggregation operations – MongoDB queries to the next level

Commonly, when we work with MongoDB and want to retrieve documents from a collection we make use of the method find or a variation combined with some kind of filtering or processing on the code side. For most cases, the previous technique is going to be good enough, but there will be some other cases where that won’t be enough. For instance: The filtering or processing on the code side is becoming expensive due to the number of documents. The…

Read More Read More

How to auto populate fields with MongoDB and Mongoose

How to auto populate fields with MongoDB and Mongoose

In case you have used MongoDB and mongoose together, maybe you did find yourself in a situation similar to this: In this case, we have a Schema with a property called “platforms” which is basically an array of objects. The key point to be noticed here is that every “platform” is a model already defined in our project and what we are doing here is trying to maintain a relationship between an account and the platforms it’s valid for. If you are coming from…

Read More Read More