Тёмный

MERN Stack Tutorial #4 - MongoDB Atlas & Mongoose 

Net Ninja
Подписаться 1,6 млн
Просмотров 113 тыс.
50% 1

In this MERN tutorial we'll set up a database using MongoDB Atlas, and then connect to it from our application using a package called Mongoose.
⭐⭐ Get the full course now (without ads) on the Net Ninja Pro site:
netninja.dev/p...
⭐⭐ Get access to all free & PREMIUM courses on Net Ninja Pro:
net-ninja-pro....
🥷 Course Files (GitHub):
github.com/iam...
💻 Node.js & Express Crash Course:
On Net Ninja Pro - netninja.dev/p...
On RU-vid - • Node.js Crash Course T...
💻 MongoDB Crash Course:
On Net Ninja Pro - netninja.dev/p...
On RU-vid - • Complete MongoDB Tutor...
💻 React Full Courses:
On Net Ninja Pro - netninja.dev/p...
On Udemy - www.thenetninj...
On RU-vid - • Full React Tutorial #1...
🔥🔥🔥 Other resources:
React Context & Hooks tutorial (on RU-vid) - • React Context & Hooks ...
VS Code - code.visualstu...
MongoDB Atlas -www.mongodb.co...
POSTMAN - www.postman.co...

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 95   
@estoriassurreais3434
@estoriassurreais3434 2 года назад
Man, you are the best dev teacher, what others take 10 hours, you teach in 8 min video :D love you
@raufukiwala
@raufukiwala 2 года назад
You can say that again friend
@raufukiwala
@raufukiwala 2 года назад
I will admit I have tried before following say 7-hour mern stack tutorials but still, I was struggling with simple things. This series is different, I'm now able to digest everything and watch every piece come together. Even the basic REST CRUD operations in video #3 are so concise that I now fully got the concept. Hopefully, I will be able to code a simple to-do app using the knowledge I will acquire from this series. Thank you so much NetNinja
@deepkodes4434
@deepkodes4434 Год назад
yess unless you understand the simple projects and drill down the basics, big projects dont make any sence.
@deyonyt
@deyonyt Год назад
You just gained a subscriber man. By now I've watched a 60h udemy course and a few other courses on RU-vid, most of them around 6-10h. However, it was you who cleared my concepts properly. They did teach a lot more and dug deep into every concept and im sure that it'll only help in the long run but for someone who's beginning their journey, id certainly prefer concise to the point explanations with a very high level overview of the subject. We will learn more about it along the journey. That's why I loved your tutorial. Thank you. Sure, watching those previous videos certainly did help in grasping your code faster and so to anyone reading this comment and is a beginner like me, please watch as many videos as possible. You never know what clicks for you. This one did for me.
@amkamwebavenger3870
@amkamwebavenger3870 2 года назад
The course is going well and I'm finally learning the MERN the real and comprehensive way. Thanks so much my Ninja. Much love bro, you're the best.
@georgeolufemi4285
@georgeolufemi4285 2 года назад
Can't wait for the full tutorial and the Authentication tutorial too. Learning simplified 👌🏽. Thank you Netninja.
@NetNinja
@NetNinja 2 года назад
Thanks George :)
@slicknature
@slicknature 2 года назад
@@NetNinja I can’t wait as well! When is authentication series coming out?
@Stevenalp18
@Stevenalp18 10 месяцев назад
This dude is great! He literally taught me what a bootcamp tried to teach, but they confused me more, the crazy part is, he does it for FREE! I subscribed and joined his group, definitely deserves the support yall!
@NetNinja
@NetNinja 10 месяцев назад
Thanks Steven, that means a lot :)
@hadibaalbaki5097
@hadibaalbaki5097 2 года назад
super excited for this series, I've been searching forever for a good MERN course and i can't believe i found you starting a new one
@valeriynehovora6652
@valeriynehovora6652 2 года назад
Had a problem with the connection DB, because my password for DB contained the symbol '@' . Do not use it!🙂 Thank you a lot for the tutorial!
@margaretwhyte2514
@margaretwhyte2514 Год назад
I'm so glad I found this! Learning has never been this interesting and easy. Thank you so much!!!!!!!
@NetNinja
@NetNinja Год назад
You're very welcome Margaret :) thanks for watching
@interfacts11
@interfacts11 2 года назад
What you have done for us it is amazing! and we really like your Mern Stack videos. Please don't stop teaching. We are looking forward to your lesson! Thanks a lot! Ninja dev
@NetNinja
@NetNinja 2 года назад
Thanks Husan :) much appreciated!
@radiantreflaction
@radiantreflaction 2 года назад
Thank u for this awesome series..love the way you explain things...plz upload 2 videos in a day if possible
@thevooiiD
@thevooiiD 2 года назад
You people are just doing great work.👌 Don't stop.
@NetNinja
@NetNinja 2 года назад
Thanks Amit :)
@TRAILER_ROLLERCOSTING
@TRAILER_ROLLERCOSTING 4 месяца назад
Thanks man,i've been having issues connecting to mongo this helped me
@NetNinja
@NetNinja 4 месяца назад
Awesome, glad it helped :)!
@spatol
@spatol Год назад
To those now trying out this, the Mongoose v7 allows for strict connection to db. A simple way around this is by setting mongoose.set(): mongoose.set('strictQuery',false); mongoose.connect("mongodb uri") .then(() => { ................... }) .catch(() => { ....................... } ) This helped me avoid errors. Hope this helps
@rakinar2
@rakinar2 2 года назад
Cool! I absolutely loved this tutorial!
@andersonsimeon4172
@andersonsimeon4172 2 года назад
Wow.. U posted the course just when I needed it.. Thank you very muchh...
@NetNinja
@NetNinja 2 года назад
Awesome, hope it was helpful Anderson! :)
@daniealkenji7322
@daniealkenji7322 Год назад
thank you Net Ninja! -from a student from a third world country
@patrinov
@patrinov Год назад
You saved me a lot of head banging, thanks alot
@ghofranedarragi5601
@ghofranedarragi5601 2 года назад
you make things '' easy peasy lemon squeezy ''
@johnpaulpineda2476
@johnpaulpineda2476 2 года назад
Ow yes. Thanks shaun!
@NetNinja
@NetNinja 2 года назад
Thanks John :)
@mrgrossartig
@mrgrossartig Год назад
Great tutorial, thank you. 😊
@AdamCanDoIt
@AdamCanDoIt 2 года назад
Wow, your videos are great, keep up the great work! Quick question, how would I host something like this in the end (ideally for free)? Could I use something like Vercel, or does that not allow express? And would you you MongoDB Atlas for production, and then host everything else (frontend and express part of backend) on something else? Thanks!
@rajnishkushx
@rajnishkushx 8 месяцев назад
You're the best, i subscribed you right away, ser
@ilan117
@ilan117 2 года назад
Hi Shaun … are you able to say when will you be adding the user model so we can save a workout per user I guess using the objectID ? I am really looking forward to that 🤲
@mgr1282
@mgr1282 2 года назад
Thanks sensei. PLZ consider Prisma.
@trcsports7788
@trcsports7788 9 месяцев назад
Hi, I'm running through your tutorials. I'm getting the following error. Any ideas of what to do? I believe I need to change my version of one of the packages but I'm not sure where to go from there. (node:38660) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) MongoServerError: bad auth : authentication failed
@muhammadbilalmalik7292
@muhammadbilalmalik7292 2 года назад
Net ninja please tell vue.js vs angular what should be choosen only one between these two to learn!!
@shawn.builds
@shawn.builds Год назад
Fire!!!!!!
@ghofranedarragi5601
@ghofranedarragi5601 2 года назад
thanks , like always simple and clear explanation
@NetNinja
@NetNinja 2 года назад
You're welcome! :) hope it was useful
@ghofranedarragi5601
@ghofranedarragi5601 2 года назад
@@NetNinja yes it was ^^
@yinonb172
@yinonb172 2 года назад
Thanks sensei !!
@alexg7282
@alexg7282 2 года назад
Thank you !
@jumhuur
@jumhuur 2 года назад
thanks so muck ninja
@alihamoud6863
@alihamoud6863 2 года назад
All love ❤
@journeyjeon-m2z
@journeyjeon-m2z Год назад
awesome! Thank u
@kim92se64
@kim92se64 2 года назад
going so well
@101kawsar
@101kawsar 2 года назад
I would request you to do some Python, like Django or Flask or FastAPI. Would be really cool if you do Mongodb with Flask or FastAPI :)
@taofeekiyanda3050
@taofeekiyanda3050 2 года назад
He has Playlist for Django. Check his channel
@101kawsar
@101kawsar 2 года назад
@@taofeekiyanda3050 that playlist is old and I know Django. I just wanted to see something outside Js world, because nowadays his all contents are Js related.
@deepkodes4434
@deepkodes4434 Год назад
can u tell me how to use local mongodb as well, as that is what we need to do in projects
@davidhusted817
@davidhusted817 Год назад
Thanks sir i have a problem when create any name for cluster i get "this project has already another free cluster
@anonymousghost5384
@anonymousghost5384 2 года назад
Awesome What about nestJs
@WEBDEVIndo
@WEBDEVIndo 2 года назад
Stuck on connecting to mongodb atlas with error: queryTxt ETIMEOUT
@guru6031
@guru6031 2 года назад
Same here..
@akishtp
@akishtp 2 года назад
You guys found any solutions?
@WEBDEVIndo
@WEBDEVIndo 2 года назад
I found solution by using node.js version 2.xx.x instead version 4.1 on connection setup
@akishtp
@akishtp 2 года назад
@@WEBDEVIndoI found that out already, but thanks anyway. It works.
@guru6031
@guru6031 2 года назад
@@WEBDEVIndo thanks bro
@doniaelfouly4142
@doniaelfouly4142 Год назад
thanks
@HadesTimer
@HadesTimer 2 года назад
So I'm getting this error every time I try to run your built code: MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string. I thought it was something I did wrong in coding so I built the code on your GitHub and I still got it. I've checked my .env file multiple times and it seems to be right.
@nirajs.golhar7609
@nirajs.golhar7609 2 года назад
Things you can check to make this work - 1) make sure you have the string entered in your first parameter so that you can directly enter the URI at the first parameter and not use .env file. 2)run the command and npm install mongoose or npm install if you have cloned repo from Github 3) make sure you enter the correct username and password from the mongoose DB (check your mongoose atlas DB)
@HadesTimer
@HadesTimer 2 года назад
@@nirajs.golhar7609 Thanks. I went over it all again. Honestly I don't know what I did but it finally worked. I wish I knew what was wrong. I think it had something to do with either the password or the code I that I copied into the "MONGO_URI=" line. Took me more than an two hours to solve. I can't believe a simple copy/paste error could be that much of a problem. Well, I just hope it doesn't happen again. Just for the future, does this have to do with me not knowing Javascript well enough or me not know MongoDB well enough? Because I really felt lost debugging this.
@אביעדבןיעיש
@אביעדבןיעיש 2 года назад
@@HadesTimer wait i have the same problem what to do????
@ryany4030
@ryany4030 2 года назад
@@HadesTimer your password contains special characters like ('@').
@khaledalshishani3369
@khaledalshishani3369 Год назад
@@אביעדבןיעיש Hi, make sure your .env file is inside the backend folder
@knowlegeurdu8983
@knowlegeurdu8983 Год назад
Sir I face an issue whenever I start the server, I get warning to add mongoose.set('strictQuery', true);
@אביעדבןיעיש
@אביעדבןיעיש 2 года назад
MongooseServerSelectionError: unable to get local issuer certificate at Connection.openUri i have this err when trying to connect to mongodb can you help me?
@אביעדבןיעיש
@אביעדבןיעיש 2 года назад
I found the solution The problem was the new node version Just use the recommended version of node
@CodingSnippets2.0
@CodingSnippets2.0 2 года назад
I am getting an error when try to connect to mongodb. When I run the server it gives etimeout error in console..my internet is fine and have installed latest version of node js but getting this etimeout error.. Kindly help..thanks
@qwertzuiop1978
@qwertzuiop1978 4 месяца назад
Question: Does anybody know can we use mongoDB Atlas free tier (sandbox cluster that ninja showed us) for commercial purposes? I am planning on making a startup and all I would need is save the appointment data on some cloud.
@batuhanbatuhan4131
@batuhanbatuhan4131 2 года назад
now we have many players they all throw errors to god knows where and we access to those errors by saying catch I assume there is like a global object on the background and we use its catch method. and I guess curly braces are creating a nested hierarchy to catch the error or it may be completely different I am just speculating because these are all new to me and honestly I do not like dealing with errors I dont like try catch it confuses md
@mohamedyoussef8835
@mohamedyoussef8835 Год назад
Awesome video ++++++++++++++++++ 🙂
@MikeMcAllister215
@MikeMcAllister215 Год назад
I had tio get hte 6.8.0 of mongoose to get this working
@yusha790
@yusha790 2 года назад
Can we see later mevn stack please ?
@NetNinja
@NetNinja 2 года назад
I will do this at some point soon too :)
@trexon2360
@trexon2360 Год назад
mongose doesnt recognize the connect method
@SaiBaba-zi5my
@SaiBaba-zi5my 8 месяцев назад
I am note getting any errors, but the MongoDB is not getting connected and the collection is not getting created. Can anybody help??
@Jane-cq9ku
@Jane-cq9ku 7 месяцев назад
did you change with your actual password in MONGO_URI?
@SaiBaba-zi5my
@SaiBaba-zi5my 7 месяцев назад
@@Jane-cq9ku Figured it out 👍🏼
@MuhammadRizky-ub3oy
@MuhammadRizky-ub3oy 2 года назад
i love u so much
@NetNinja
@NetNinja 2 года назад
Thanks Muhammad :)
@towatch
@towatch 2 года назад
❤️❤️💕👍🏻
@BilalAhmed-tw5cr
@BilalAhmed-tw5cr 2 года назад
does any1 mongo site take forever to load 😪😪
@sametrise
@sametrise 2 года назад
Can you post all parts of the course at a time
@carloseduardosanchezcarras4151
@carloseduardosanchezcarras4151 7 месяцев назад
tienes que hacer el video en español brother hahahaha
@Pareshbpatel
@Pareshbpatel Год назад
{2023-02-18}
@arney1
@arney1 8 месяцев назад
mongonetworkerror :(
@arney1
@arney1 8 месяцев назад
yea my network was just slow af
@sayemalmahdi6691
@sayemalmahdi6691 Год назад
Dated on 2 February 2023 For me, I had to write "// connect to db 2 times" and also add "mongoose.set('strictQuery', false);" at the top. I don't know how it works but it works for me !! server.js File: require('dotenv').config() const express = require('express') const mongoose = require('mongoose') mongoose.set('strictQuery', false); const workoutRoutes = require('./routes/workouts') // express app const app = express() // middleware app.use(express.json()) app.use((req, res, next) => { console.log(req.path, req.method) next() }) // routes app.use('/api/workouts', workoutRoutes) // connect to db mongoose.connect(process.env.MONGO_URI) .then(() => { // listen to port app.listen(process.env.PORT, () => { console.log('listening for requests on port', process.env.PORT) }) }) .catch((err) => { console.log(err) }) mongoose.connect(process.env.MONGO_URI) .then(() => { app.listen(process.env.PORT, () => { console.log('listening for requests on port', process.env.PORT) }) }) .catch((err) => { console.log(err) })
@Harsh-jh2ql
@Harsh-jh2ql 2 месяца назад
exactly, it works for me with this method, did you resolve this issue????
@BiyasGhosh
@BiyasGhosh 5 дней назад
I am having the same issue but not understanding the problem
@mdsafikulislam9113
@mdsafikulislam9113 2 года назад
Thanks
Далее
MERN Stack Tutorial #5 - Models & Schemas
12:43
Просмотров 97 тыс.
Песня РАСПУТИН на русском!🔥
00:56
MERN Stack Tutorial #3 - Express Router & API Routes
13:38
MongoDB Atlas
15:54
Просмотров 4 тыс.
MongoDB Crash Course
29:59
Просмотров 692 тыс.
Setup MONGO DB ATLAS for a MERN STACK app in 2024
6:40
MERN Stack Tutorial #6 - Controllers (part 1)
14:32
Просмотров 87 тыс.
MERN Stack Tutorial #11 - Adding React Context
26:31
Просмотров 78 тыс.