How to Connect a MongoDB Database to React

Published: 03 October 2023
on channel: Austin Davis
4,684
58

Want to build a full stack application between React and MongoDB? Look no farther, because in this video we'll go over the setup process for connecting a MongoDB database to your React project.

MongoDB is a database system that you can access for free online. It allows you to store data in NoSQL format, where data are stored in the form of "collections" and are formatted very similarly to JavaScript objects (JSON notation).

By connecting MongoDB to React, this allows React developers to access MongoDB from INSIDE React code in order to add, edit, and delete collections and data from MongoDB, while also allowing many other features as well.

This is the first step (and arguably one of the most crucial ones) towards making a full-stack application. To fully complete this full-stack process, you'll be advised to use a backend framework like Express JS to handle all the functionality between React and MongoDB. While we can handle MongoDB requests in React directly, it is much easier and more efficient to do so using middleware like Express.

We will discuss Express in a future video!

Timestamps:
0:00 - MongoDB Setup
1:53 - Databases/Collections
3:48 - Connection w/ React
9:00 - Testing Connection

Hashtags:
#reactjs #reacttutorial #programming