NestJS + MongoDB

Hey guys, let’s create a NestJS REST API, but before moving forward make sure you have read the Getting Started article first.

As in our last article, we got familiar with basic NestJS concepts, let’s get started and make a connection with the database and create an actual REST API.


For databases, you can use MySQL, MongoDB, or PostgreSQL, and many more…, But for this example, we will be using MongoDB, and to connect that with our application we will use the mongoose as ODM which allows us to connect with the database and provides more flexibility in terms of…

Application overview, Installation & Setup



NestJS is a backend framework, build on top of NodeJS and ExpressJS to create server-side applications, it is best suited for REST APIs as it is really quick to get a REST API running with NestJS. It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript), and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming). The architecture of the NestJS is mostly inspired by AngularJS.

Pre-requisite in terms of technical knowledge:

  • Knowledge of modern JS programming approaches.
  • Experience in working with NodeJS, ExpressJS, Typescript (Not a requirement, but this will…

Lav Shah

A MERN Stack Javascript enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store