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 М.
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
БЕЛКА СЬЕЛА КОТЕНКА?#cat
00:13
Лайки Like
Рет қаралды 2,7 МЛН
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 9 МЛН
MongoDB in Python - NoSQL Document Database
24:33
NeuralNine
Рет қаралды 50 М.
1.9 - Intro to Anaconda and Spyder IDE for Python  Programming
18:17
Connect MongoDB with Node.js using mongoose | MongoDB + Express.js
10:44
Node.js Tutorial - 16 - ES Modules
9:46
Codevolution
Рет қаралды 46 М.
DHH - Ruby on Rails, 37signals, and the future of web development
1:09:57
Postgres just got even faster
26:42
Hussein Nasser
Рет қаралды 31 М.
19
1:23:25
py
Рет қаралды 12
Learn Web Development And ACTUALLY Get A Job | Ultimate Guide
1:33:52
James Cross
Рет қаралды 1,4 МЛН
Complete MongoDB Tutorial #4 - Using MongoDB Compass
10:29
Net Ninja
Рет қаралды 310 М.
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17