JavaScript MongoDB NestJS TypeScript

API with NestJS #47. Implementing pagination with MongoDB and Mongoose

This entry is part 47 of 56 in the API with NestJS

When our application grows, so does the database. At some point, we might return a lot of data from our endpoints. It might prove to be too much for our frontend application to process, for example. Therefore, we might need to paginate our records by returning just a portion of them. This article explores different ways […]

JavaScript MongoDB NestJS TypeScript

API with NestJS #45. Virtual properties with MongoDB and Mongoose

This entry is part 45 of 56 in the API with NestJS

In this series, we’ve used Mongoose to define properties in our schemas and work with models for documents. We’ve also defined various relations between collections. With Mongoose, we can also take advantage of virtual properties that are not stored in MongoDB. To understand them, we first grasp the concept of getters and setters. You can find the code […]

JavaScript MongoDB NestJS

API with NestJS #43. Introduction to MongoDB

This entry is part 43 of 56 in the API with NestJS

So far, in this series, we’ve focused on working with SQL and the Postgres database. While PostgreSQL is an excellent choice, it is worth checking out the alternatives. In this article, we learn about how MongoDB works and how it differs from SQL databases. We also create a simple application with MongoDB and NestJS. You […]

JavaScript SQL

Defining constraints with PostgreSQL and TypeORM

An important part of designing a database is controlling the data we store inside. The most fundamental way of doing that is defining the types for our columns. With that, we can make sure that a particular column holds only text, for example. In this article, we use constraints to have even more control of […]

JavaScript NestJS TypeScript

API with NestJS #42. Authenticating users with Google

This entry is part 42 of 56 in the API with NestJS

Authenticating users with emails and passwords is a valid and common approach. However, a convenient alternative is to shift this responsibility to a third party. In this article, we look into adding Google authentication to a NestJS project. We can achieve the above because Google uses the OAuth (Open Authorization) framework. With it, Google users […]