Populate fields with Mongoose

There is no join in MongoDB, but using the populate function of Mongoose we will return merged documents from the ExpressJS project which was created in previous posts. So far we only had the Entry objects defined, now I will extend the REST API a little bit and introduce a new model. Then we will see how to fetch the related documents in one query.



Tagged with
Comment
Just a mongoose

Using Mongoose with Express

In this post I will start MongoDB on my local machine and use Mongoose to describe the objects we used in the previous post, where I started creating an ExpressJS project. We will create a schema to define our object model, add some validation and update the routes we created to use the new backend. We will also take a look at a managed MongoDB service mLab, which offers Database-as-a-Service and has a free sandbox.



Tagged with
Comment