Voyage AI joins MongoDB to power more accurate and trustworthy AI applications on Atlas.

Explore Developer Center's New Chatbot! MongoDB AI Chatbot can be accessed at the top of your navigation to answer all your MongoDB questions.

MongoDB Developer
JavaScript
plus
Sign in to follow topics
MongoDB Developer Center
chevron-right
Developer Topics
chevron-right
Languages
chevron-right
JavaScript
chevron-right

How to Batch Download Content & Media from Your Database

32 min • Published Jul 07, 2025
Node.jsMongoDBJavaScript
Facebook Icontwitter iconlinkedin icon
Rate this video
star-empty
star-empty
star-empty
star-empty
star-empty
✅ Try MongoDB 8.0 → https://mdb.link/_bg6bv0hZyY-try ✅ Sign-up for a free cluster → https://mdb.link/_bg6bv0hZyY-register ✅ Subscribe to MongoDB YouTube → https://mdb.link/subscribe Ever needed to move your content out of a database and onto your local file system? In this practical, no-fluff tutorial, we walk you through a powerful Node.js script designed to export your content and all its media assets directly from MongoDB. Follow along as we build a script from scratch that reads a list of content, queries MongoDB using an aggregation pipeline, and then automatically downloads all associated images and media files, organizing everything neatly for you. This is a real-world example of how to use MongoDB and Node.js to solve a common content migration challenge, perfect for anyone managing a CMS or needing to batch-export data. Chapters: 00:00 Introduction & Use Case 00:52 Project Setup & Dependencies 03:37 Boilerplate Code Explained 06:10 Loading URL Slugs from File 08:59 Querying MongoDB with Aggregation Pipeline 13:33 Saving Markdown to Local File System 16:48 Saving Metadata to Local File 19:40 Extracting Asset URLs from Markdown 23:36 Downloading Assets with Axios 30:46 Final Thoughts & Conclusion This video is not affiliated with, endorsed by, or sponsored by Node.js. The use of any trademark is solely for informational and identification purposes, so that we may provide clear and accurate descriptions. All opinions and critiques provided in this video are those of the creator and do not reflect the views of Node.js or its affiliates. Visit Mongodb.com → https://mdb.link/MongoDB Read the MongoDB Blog → https://mdb.link/Blog Read the Developer Blog → https://mdb.link/developerblogAll MongoDB Videos

Facebook Icontwitter iconlinkedin icon
Rate this video
star-empty
star-empty
star-empty
star-empty
star-empty
Related
Code Example

Final Space API


Jul 07, 2022 | 1 min read
Tutorial

Getting Started With MongoDB Atlas Serverless, AWS CDK, and AWS Serverless Computing


Aug 09, 2024 | 18 min read
Code Example

Chember


Jul 07, 2022 | 4 min read
Tutorial

How to Deploy an Application in Kubernetes With the MongoDB Atlas Operator


Mar 13, 2025 | 9 min read