🔴 Connect MongoDB Atlas with NodeJS using Mongoose

  Рет қаралды 23,632

New Age Coder

New Age Coder

2 жыл бұрын

Hello Developers, Hope you all will be fine. In today's video, we are going to connect the MongoDB account using mongoose, I hope u all like that
📁 Exceserios :
Download Node js - nodejs.org/en/download/
MongoDB - account.mongodb.com
Thank u and have a great day💖😀
⭐ About My Text Editor:-
Editor:- Visual Studio Code
Theme:- Vitesse Dark
Font:- Cascadia Code
Please consider subscribing to my channel for more awesome videos 🙏.
kzbin.info/door/W7I...
--------------------------------------------------------------------------------------
Music Credits 🎵:
ikson - harmony official, Ehrling - You And Me
Music provided by Vlog No Copyright Music.
Have a great day💖😀

Пікірлер: 55
@amritapattnaik3345
@amritapattnaik3345 Жыл бұрын
can someone paste the code :)
@newagecoder5417
@newagecoder5417 Жыл бұрын
Sure
@amritapattnaik3345
@amritapattnaik3345 Жыл бұрын
@@newagecoder5417 code ?and if you have the docker file for this ?
@newagecoder5417
@newagecoder5417 Жыл бұрын
const express = require("express"); const app = express(); const mongoose = require("mongoose"); // Database const database = (module.exports = () => { const connectionParams = { useNewUrlParser: true, useUnifiedTopology: true, }; try { mongoose.connect( "mongodb+srv://username:password@cluster0.0ehgx.mongodb.net/mongodb?retryWrites=true&w=majority", connectionParams ); console.log("Database connected succesfully"); } catch (error) { console.log(error); console.log("Database connection failed"); } }); database(); app.listen(3000, () => { console.log("Server is running on port 3000"); });
@newagecoder5417
@newagecoder5417 Жыл бұрын
@@amritapattnaik3345 sorry but I don't have it
@newagecoder5417
@newagecoder5417 Жыл бұрын
@@amritapattnaik3345 hmm sorry u need to use your let me edit it, Use your BCS It will not work
@bartjunior1
@bartjunior1 Жыл бұрын
Brother, here in Brazil I really needed to learn this connection, but here it is very difficult to find someone to explain how to make the connection, I'm glad I found your video. For me it was a great class, you gained another follower.
@newagecoder5417
@newagecoder5417 Жыл бұрын
thank u soo much bro love u from india ❤❤
@solanaromero2085
@solanaromero2085 Жыл бұрын
Thank you so much for this video. Ive been trying to connect the atlas to my project for about 2 hours now and I couldnt make it work, but thanks to you I could!!!! Omg I'm so happy! thank you thank you thank you thank you!!!!
@newagecoder5417
@newagecoder5417 Жыл бұрын
🎉 congratulations bow you can start your work
@johncullen5903
@johncullen5903 2 жыл бұрын
Thank you for this video, New Age Coder. It really helped!😀😁
@newagecoder5417
@newagecoder5417 2 жыл бұрын
Thank you ❤️
@armansyah8892
@armansyah8892 Жыл бұрын
thank you so much bro, u already got a new subscriber here
@newagecoder5417
@newagecoder5417 Жыл бұрын
🧡 thank you arman I am really glad that this video helped you
@raveclipsbypayrave4578
@raveclipsbypayrave4578 2 жыл бұрын
Bro. I was having an issue with installing this for over 6 hours. I watched videos from even MongoDB themselves and couldn’t solve the issue. I just decided to give your video a try and it worked immediately! You’ve earned yourself a subscriber and constant video watcher! Thanks for releasing this video. I am honestly happy I found you. Cheers!
@newagecoder5417
@newagecoder5417 2 жыл бұрын
Thank u so so so much bro ❤️ for your support And you have given me a lot of motivation 🙂
@raveclipsbypayrave4578
@raveclipsbypayrave4578 2 жыл бұрын
@@newagecoder5417 🔥
@newagecoder5417
@newagecoder5417 Жыл бұрын
​@@raveclipsbypayrave4578 Hi bro hope you are fine I need ur help. Can you help me make a video 📹. Are you facing any errors which I can help you?
@raveclipsbypayrave4578
@raveclipsbypayrave4578 Жыл бұрын
@@newagecoder5417 yeah. I’m finding it hard to use checkboxes in react. If you could make a video where you use checkboxes and display what was chosen on a single page, that’d be cool
@newagecoder5417
@newagecoder5417 Жыл бұрын
@@raveclipsbypayrave4578 awesome bro video coming soon
@MrDubYT
@MrDubYT Жыл бұрын
Thanks bro. i rlly need a short video of this
@archipremium
@archipremium Жыл бұрын
thanks, your videos really helped me
@noanswerrs
@noanswerrs Жыл бұрын
Thanks very much for making this video, I was stuck in some tutorials that were not working, I tried this and it WORKED, amazing job, also I like this types of video where you don't talk and just have writting so you can follow along easier
@newagecoder5417
@newagecoder5417 Жыл бұрын
Thank you soo much sir. Can you recommend some ideas for more videos
@noanswerrs
@noanswerrs Жыл бұрын
@@newagecoder5417 I am actually working on a project and will need to do the steps right that come after this. If that's something you would like to do. Keep it up!
@austinlynch7490
@austinlynch7490 2 ай бұрын
great work
@kramerkramer-yl7us
@kramerkramer-yl7us 7 ай бұрын
thanks alot you saved me
@bunny.rider69
@bunny.rider69 Жыл бұрын
thanks bachhi its works 😎🔥🔥🔥🔥
@saharzada9773
@saharzada9773 Жыл бұрын
thanks man really helped me here
@newagecoder5417
@newagecoder5417 Жыл бұрын
I am glad that it helped 🥰
@njorogekamau3820
@njorogekamau3820 Жыл бұрын
Thanks Man !
@newagecoder5417
@newagecoder5417 Жыл бұрын
💝
@fernandolopez6853
@fernandolopez6853 Жыл бұрын
Buen video , solucion facil y rapida👌👍
@newagecoder5417
@newagecoder5417 Жыл бұрын
Thank you 💖😌
@sanhtran8588
@sanhtran8588 Жыл бұрын
Thank you! It helped me to solve the problem
@newagecoder5417
@newagecoder5417 Жыл бұрын
Welcome sir
@suminbaek
@suminbaek Жыл бұрын
Thanks a lot!!
@aquib399
@aquib399 Жыл бұрын
Thanks bro and what snippets and themes are u using, they seems awesome
@cagr9944
@cagr9944 Жыл бұрын
Thanks
@mohamedelaatfi1162
@mohamedelaatfi1162 6 ай бұрын
THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUU
@sushantdivekar6013
@sushantdivekar6013 Жыл бұрын
🙏
@aiswaryam6298
@aiswaryam6298 7 ай бұрын
Showing error in connection of ip address,
@khumbozimba7521
@khumbozimba7521 Жыл бұрын
what extension are you using for the autocompletion?
@newagecoder5417
@newagecoder5417 Жыл бұрын
Github copilot
@sahilraut8758
@sahilraut8758 Жыл бұрын
bro it's showing me error by saying database connection is failed
@newagecoder5417
@newagecoder5417 Жыл бұрын
Hi Sahil, did you paste the password and username correctly for Moongodb connection as shown in the 13th line please check and let me know
@mohalhakeem
@mohalhakeem Жыл бұрын
Instead of typing in Notepad you can use free video apps such as DaVinci Resolve and add text on the video...
@newagecoder5417
@newagecoder5417 Жыл бұрын
Thank u for your opinion sir, I will definitely do it
@sanchalisharma9149
@sanchalisharma9149 Жыл бұрын
distracted constantly by notepad
@newagecoder5417
@newagecoder5417 Жыл бұрын
const express = require("express"); const app = express(); const mongoose = require("mongoose"); // Database const database = (module.exports = () => { const connectionParams = { useNewUrlParser: true, useUnifiedTopology: true, }; try { mongoose.connect( "mongodb+srv://username:password@cluster0.0ehgx.mongodb.net/mongodb?retryWrites=true&w=majority", connectionParams ); console.log("Database connected succesfully"); } catch (error) { console.log(error); console.log("Database connection failed"); } }); database(); app.listen(3000, () => { console.log("Server is running on port 3000"); });
@newagecoder5417
@newagecoder5417 Жыл бұрын
take this code and paste it on your file and change the username and password thank u
@sanchalisharma9149
@sanchalisharma9149 Жыл бұрын
@@newagecoder5417 and I was so frustrated because of that I watched your video and still get nothing. So I wrote that.🙂🙂
@newagecoder5417
@newagecoder5417 Жыл бұрын
@@sanchalisharma9149 No problem, is it working now?
@sanchalisharma9149
@sanchalisharma9149 Жыл бұрын
@@newagecoder5417 unfortunately no . I have put the whole URL directly . .env is not working.
Connecting NodeJS with MongoDB | Mongoose + Express
19:18
Piyush Garg
Рет қаралды 86 М.
Getting Started with MongoDB Atlas - A Modern Database!
19:56
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 58 МЛН
Wait for the last one! 👀
00:28
Josh Horton
Рет қаралды 114 МЛН
МАМА И STANDOFF 2 😳 !FAKE GUN! #shorts
00:34
INNA SERG
Рет қаралды 3,8 МЛН
Универ. 13 лет спустя - ВСЕ СЕРИИ ПОДРЯД
9:07:11
Комедии 2023
Рет қаралды 6 МЛН
Connect to MongoDB Atlas through NodeJS | INFY TECH
8:52
INFY TECH
Рет қаралды 35 М.
Connect Mongodb Atlas to nodejs and Express Server
34:40
Red Eye Media
Рет қаралды 8 М.
Build a Totally Serverless REST API with MongoDB Atlas
18:57
How to Connect Node.js App to MongoDB | Node.js & MongoDB Tutorial
12:41
How is THIS Coding Assistant FREE?
5:19
Alex Ziskind
Рет қаралды 142 М.
How to use Mongoose with Next js 14 +?
26:20
AyyazTech
Рет қаралды 6 М.
What are HTTP Headers in API
17:38
Piyush Garg
Рет қаралды 47 М.
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 58 МЛН