Connecting to MongoDB in Node.js

  Рет қаралды 2,624

Christian Hur

Christian Hur

Күн бұрын

⭕ Overview
Hello, this is Christian. In this video, we're going to connect to a MongoDB database system using the MongoDB library for Node.js. Before we dive into the coding, let's review the CRUD operations (Create, Read, Update, Delete) for MongoDB, which are essential for interacting with the database.
We'll start by visiting the MongoDB documentation website, where you'll find detailed explanations and examples for each CRUD operation. The left navigation menu provides links to perform operations like insert, select (query), update, and delete.
In this session, I'll demonstrate how to use JavaScript functions to perform these operations. If you need a refresher, all the information is available on the MongoDB documentation site.
Before we begin coding, ensure that MongoDB is running on your system. We'll use MongoDB Compass, a graphical interface that makes it easy to interact with your database. If you haven't installed it yet, make sure to do so. Compass is the preferred tool for managing MongoDB databases.
In my previous exercises, I've created a database called "Unit6DB" with a collection named "students" where I've already inserted about 100 records for testing purposes. You can create any database and collection of your choice for this demo, but I'll be using my pre-existing setup to perform the CRUD operations.
We'll keep MongoDB Compass running to visualize our data as we perform these operations. This will help you see the real-time impact of the code we write.
By the end of this tutorial, you'll be comfortable connecting to a MongoDB database using Node.js, performing CRUD operations, and using MongoDB Compass to manage and visualize your data.
Note: For local MongoDB databases, use the IP address "127.0.0.1" instead of "localhost" because Node.js 18 and up prefer IPv6 addresses. This means, on many machines, Node.js will resolve "localhost" to the IPv6 address "::1" and it might be unable to connect, unless the mongodb instance is running with ipv6 enabled.
If you find this video helpful, please give it a thumbs up, share it with your friends, and subscribe to my channel for more tutorials and insights into programming. Your support helps me create more content to assist you in your learning journey. Thank you for watching!
⭕ Chapters
0:00 - Introduction
⭕ About me
I am a Web instructor and author for Linkedin Learning (formerly Lynda.com), Packt, E-C Council, Udemy, and MC Press.
⭕ Visit my site: christianhur.com
⭕ My complete online training courses:
☑️ REST APIs & AJAX Operations Using Node, Express, and jQuery: www.udemy.com/...
☑️ Build Clean and Secure PHP Web Apps From Scratch: www.udemy.com/...
☑️ Angular 9 New Features: www.packtpub.c...
☑️ Full-Stack Web Development with Flask: www.packtpub.c...
☑️ Full-Stack Web Development with Django & Angular 8: www.packtpub.c...
☑️ Angular 7 New Features: www.packtpub.c...
☑️ The DOM in JavaScript, jQuery, AngularJS, and React : / the-dom-in-javascript-...
☑️ Building JSF Web Applications with Java EE 7: / building-jsf-web-appli...
☑️ Troubleshooting Vue.js: www.packtpub.c...
⭕ Check out my book:
Developing Business Applications for the Web: With HTML, CSS, JSP, PHP, ASP.NET, and JavaScript is available on Amazon and MC Press.
☑️ Link: www.mc-store.c...

Пікірлер: 4
CRUD operations in Node.js using MongoDB and mongoose
39:10
Christian Hur
Рет қаралды 839
MongoDB in 18 Minutes - Intro to MongoDB
17:42
Caleb Curry
Рет қаралды 326 М.
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 2 МЛН
The joker favorite#joker  #shorts
00:15
Untitled Joker
Рет қаралды 30 МЛН
إخفاء الطعام سرًا تحت الطاولة للتناول لاحقًا 😏🍽️
00:28
حرف إبداعية للمنزل في 5 دقائق
Рет қаралды 32 МЛН
Node.js Crash Course
2:06:35
Traversy Media
Рет қаралды 187 М.
How To Connect Node.js With MongoDb Atlas Using Moongose
12:16
Tech Coffee Break
Рет қаралды 3,4 М.
Build A Restful Api With Node.js Express & MongoDB | Rest Api Tutorial
53:55
Connecting to MongoDB Using Async/Await in Node.js
12:14
Christian Hur
Рет қаралды 99
Learn Node.js & Express with Project in 2 Hours
1:42:53
Dipesh Malvia
Рет қаралды 548 М.
Complete MongoDB Tutorial #16 - Connecting to MongoDB
10:40
Net Ninja
Рет қаралды 122 М.
Python MongoDB Tutorial using PyMongo
21:24
Tech With Tim
Рет қаралды 237 М.
Unlocking the Power of NoSQL: FastAPI with MongoDB
23:57
Eric Roby
Рет қаралды 37 М.
Build A REST API With Node.js, Express, & MongoDB - Quick
28:56
Web Dev Simplified
Рет қаралды 825 М.
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 2 МЛН