Tag: javascript

Build a Movie Watchlist with Node.js, TypeScript, and MongoDB

April 13, 2026 Nic Raboy

Almost every modern web application will need a REST API for a client to talk to, and in almost every scenario, that client is going to expect JSON. The best developer experience is a stack where you can stay in JSON-shaped data end to end, without awkward transformations in the middle.

Take MongoDB, Express Framework, and Node.js as an example.

Express receives HTTP requests and sends responses. MongoDB sits in the middle and stores documents. The client can send JSON to your routes, your routes can send documents to MongoDB, and MongoDB can hand BSON back that maps naturally to what you serialize in the response. That works well because MongoDB is a document database. When you also want text search over fields like title and plot, MongoDB Search gives you a $search stage in an aggregation pipeline on the same cluster, so you are not bolting on a separate search system just to power a search box.

In this tutorial, we'll see how to build a small movie watchlist API using TypeScript and MongoDB. We'll explore a few different schema design opportunities and make use of MongoDB Search for full-text search.

Read More

Migrating Your Content Management System (CMS) Assets With MongoDB and Node.js

May 9, 2025 Nic Raboy

Content platforms evolve as business strategies shift. At MongoDB, we embraced external publishing platforms like Dev.to, Medium, The Polyglot Developer, etc. to better engage developer communities, requiring us to redistribute content while maintaining our existing CMS data in MongoDB.

To support our multi-platform publishing strategy, we created a system to publish content between our MongoDB CMS and external platforms. As a result, we needed to migrate the content we had in our CMS to its new home. The migration process included exporting the written content stored in MongoDB and downloading a copy of the media assets that were stored on third-party servers.

In this tutorial, we'll explore the export process to get the job done with as little friction as possible.

Read More

Local Development with the MongoDB Atlas CLI and Docker

April 4, 2023 Nic Raboy

Need a consistent development and deployment experience as developers work across teams and use different machines for their daily tasks? That is where Docker has you covered with containers. A common experience might include running a local version of MongoDB Community in a container and an application in another container. This strategy works for some organizations, but what if you want to leverage all the benefits that come with MongoDB Atlas in addition to a container strategy for your application development?

In this tutorial we'll see how to create a MongoDB-compatible web application, bundle it into a container with Docker, and manage creation as well as destruction for MongoDB Atlas with the Atlas CLI during container deployment.

Read More

Listen for SIGINT and SIGTERM Events in a ZX Script

January 6, 2023 Nic Raboy

Have you ever needed to handle signal events within your ZX script? For example, what happens if you need to handle a graceful shutdown of your long-running or infinite-running script? Or what happens when the user forcefully stops the script?

These signal events are typically "SIGTERM", "SIGINT", and similar events. When using a script language like Bash, these events are most commonly captured with trap commands, but what happens when we're using ZX?

In this tutorial we'll explore how to use simple JavaScript to capture signal events in a modern ZX script.

Read More

Getting Started with MongoDB Atlas and Azure Functions using Node.js

November 8, 2022 Nic Raboy

So you're building serverless applications with Microsoft Azure Functions, but you need to persist data to a database. What do you do about controlling the number of concurrent connections to your database from the function? What happens if the function currently connected to your database shuts down or a new instance comes online to scale with demand?

The concept of serverless in general, whether that be through a function or database, is great because it is designed for the modern application. Applications that scale on-demand reduce the maintenance overhead and applications that are pay as you go reduce unnecessary costs.

In this tutorial, we’re going to see just how easy it is to interact with MongoDB Atlas using Azure functions. If you’re not familiar with MongoDB, it offers a flexible document model that can be used to model your data for a variety of use cases and is easily integrated into most application development stacks. On top of the document model, MongoDB Atlas makes it just as easy to scale your database to meet demand as it does your Azure Function.

Read More

Build a Totally Serverless REST API with MongoDB Atlas

November 4, 2022 Nic Raboy

So you want to build a REST API, but you don't want to worry about the management burden when it comes to scaling it to meet the demand of your users. Or maybe you know your API will experience more burst usage than constant demand and you'd like to reduce your infrastructure costs.

These are two great scenarios where a serverless architecture could benefit your API development. However, did you know that the serverless architecture doesn't stop at just the API level? You could make use of a serverless database in addition to the application layer and reap the benefits of going totally serverless.

In this tutorial, we'll see how to go totally serverless in our application and data development using a MongoDB Atlas serverless instance as well as Atlas HTTPS endpoints for our application.

Read More

Developing Your Applications More Efficiently with MongoDB Atlas Serverless Instances

October 21, 2022 Nic Raboy

If you're a developer, worrying about your database is not necessarily something you want to do. You likely don't want to spend your time provisioning or sizing clusters as the demand of your application changes. You probably also don't want to worry about breaking the bank if you've scaled something incorrectly.

With MongoDB Atlas, you have a few deployment options to choose from when it comes to your database. While you could choose a pre-provisioned shared or dedicated cluster, you're still stuck having to size and estimate the database resources you will need and subsequently managing your cluster capacity to best fit demand. While a pre-provisioned cluster isn’t necessarily a bad thing, it might not make sense if your development becomes idle or you’re expecting frequent periods of growth or decline. Instead, you can opt for a serverless instance to help remove the capacity management burden and free up time to dedicate to writing code. Serverless instances provide an on-demand database endpoint for your application that will automatically scale up and down to zero with application demand and only charge you based on your usage.

In this short and sweet tutorial, we'll see how easy it is to get started with a MongoDB Atlas serverless instance and how to begin to develop an application against it.

Read More