Mongoose schema in node js | CRUD operation in node js with try catch statement
Vložit
- čas přidán 24. 07. 2024
- Hey everyone, In this Node.js video, we cover the creation of a Node.js project and connecting Mongoose with Node.js for effective database interactions. The course delves into Mongoose models and schemas, addressing client-to-server communication and the implementation of the POST method in Node.js Express. Participants learn about HTTP status codes, creating a POST API, and dealing with callback function issues. Further topics include asynchronous programming with async/await in JavaScript, error handling with try and catch, validating Mongoose schemas in Node.js, and understanding the GET method. The course concludes with a comprehensive exploration of CRUD operations in Node.js, emphasizing the importance of Mongoose schemas in building robust applications.
🌟🌟 Notes & Assignment: topmate.io/helloworldbyprince...
🔥 NodeJS Complete Playlist: • NodeJS Tutorial For Be...
NodeJS Bootcamp [ Day 5 ]
🔥 For the Free NodeJS course, Please Do comments and like as much as you can
❤️ Like Aim: 500
❤️ Comments Aim: 350
Hit that like button, subscribe, and ring the notification bell to never miss a frustration-busting tip! Let's crush those DSA challenges and make learning fun again! 🚀📚
----------------------------------------------------------------------------------------
Follow me on:
💼 LinkedIn► / iamprince
📷 Instagram► / helloworldbyprince
🐦 Twitter► / prince_king_
📲 Telegram► telegram.me/helloworldbyprince
📘 Facebook► / helloworldofficials
----------------------------------------------------------------------------------------
▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
00:00 Recap of mongodb
00:40 Create nodejs project
01:10 Connect Mongoose with node js
15:01 models in mongoose
17:56 Schema in node js
27:24 body parser in node js
32:24 client to server communication
33:13 post method in node js express
37:51 HTTP status codes
38:36 post api in node js
39:45 issue with callback function
41:05 async await javascript
44:22 try and catch in javascript
49:24 Mongoose validate schema in node.js
52:07 GET method in node js
55:13 CRUD operation in node js
59:17 mongoose schema node js
01:04:56 Summary of Nodejs
----------------------------------------------------------------------------------------
►Our Playlists on:-
🔥 Tree: • Tree Data Structure & ...
🔥 Stack & Queue: • Stack & Queue Data Str...
🔥 Hashing: • Hashing Data Structure...
🔥 Graph: • Graph Data Structure &...
🔥 Matrix: • Matrix (Multidimension...
🔥 Recursion & DP: • Recursion
🔥 Heap: • Heap Data Structure & ...
🔥 Linked List: • Linked List Data Struc...
🔥 STL: • Standard Template Libr...
🔥 Leetcode: • LeetCode Solutions And...
🔥Competitive Programming: • Full course in Competi...
🔥 C++ Full Course: • C++ full Course in HINDI
🔥 Algorithms: • L-01 || Prefix Sum Arr...
🔥 Data Structure: • Data Structures with C...
------------------------------------------------------------------------
🌟 Please leave a LIKE ❤️ and SUBSCRIBE for more AMAZING content! 🌟
✨ Tags ✨
#nodejs #mongodb #mongoose #nodejs #programming #coding #programminglanguage #javascript #mongodb #tutorial #learning #leetcode #linkedin #webdev #webdeveloper #webdevelopment #development #developers #layoffs #pythonprogramming #java #javatutorial #bootcamp #course #coder #programminglife #node #nodejstutorial #nodejsdevelopment #princebhai #program #codes #js #cplusplusprogramming #programminglanguage #python #geeksforgeeksgate #leetcodesolutions #dsa #dsalgo #algorithm #datastructure #hindi #mongodbtutorialforbeginners #database #faang #google #microsoft #array #vector #golanguage #helloworld #node #technology #internship #job #jobsearch
node js
node js in hindi
node js by prince
nodejs prince
node js tutorial
node js projects
nodejs event loop
nodejs microservice
node js interview
node js playlist
node js API
node js thapa
node js crash course
node js tamil
node js express
node js backend
node js interview questions
node js tutorial in hindi
node js tutorial playlist
node js tutorial by prince
node js developer
node js developer roadmap
node js developer interview
nodejs api development
node js developer full course
node js developer job
node js developer resume
#nodejs #mongodb #mongoose
Comment "#Princebhai" if you read this 😉😉
For most of the user's like me questioning where does that collection name "people" came .let's have some explanation.(say thanks as I have done research for you).😁😁.
In Mongoose, if you create a model without explicitly specifying a collection name, Mongoose will pluralize the name of the model to determine the collection name. In your case, since your model is named "Person", Mongoose will pluralize it to "people" and use that as the collection name by default. This is a common convention in MongoDB and Mongoose for naming collections.
If you want to explicitly specify a different collection name, you can do so by passing the desired collection name as the third argument when creating the model using mongoose.model(). For example:
"const Person = mongoose.model('Person', personSchema, 'my_custom_collection_name');"
Bro can you plz. share notes
anyone help in my terminal it only shows connected to mongo server it doesnt shows disconnection although i stop the mongo server
@@messi69goat hi please share more info on it
@@akshayshrivastava6057 in the video when we start mongo server the terminal print saying the server is connected and when we stop server it will say disconnected but in my case it doesn't says it is disconnected what should I do although it says it's connected
Thanks bhai
guys plz keep liking the video....for his motivation
Thanks for your support
hats off, I tried so many courses to learn back end this is the bestest and most easilyy understandable. I pray god gives u so much success and so many subscribers u really deserve it. I will be sitting for placement in august and this videos make me feel very hopeful. thank you
bohot sahi study krwate he bhaiya.....Thank u so much....
.
A perfect course for node.js and backend as well. Much more then a paid course. Please don't leave it incomplete 🥰😘
To bhi Tera sb sahi se run hora he ,cmd me kuch error nahi Ara he??
@@tricksforsolving2804 han bhai sab sahi run ho raha he
@@Kabir-777 sahi he fir
nodeman ka error aa rha hain mera toh
Thanks Bhaiya for the Amazing Course and hardwork you put in this course 😍
Literally speaking ,this course has boost my confindence
Top notch content. I wish you get a millions of subscribers this year🤞
Maza aagya bhaiya pdhke aapse concepts clear hogye
homework krte hai bhaiya... these lectures are amazing
Thank you for the course😇
Thanks so much for this amazing course
thank you , this is very simple to undersatnd
was waiting for this 👍🏻
Hope you enjoyed it!
One of the best node.js tutorial. Great explaination
Bro can you plz. share notes
Thanks bhai for world best node course
prince bro the way you teach is fabulous and makes complex topics digestible... I am currently looking for job as a fresher but people wants only experienced others are not responding😢
best of best bhai ...Thanku so much.....
Truly Helpfull
So nice of you
well explain bhaiya,homework done...
thanks bhaiya you deserve a million followers
I'm not the person who comments on any of the videos, but the way you teach is just amazing.
I am grateful that I found your channel when I started learning the backend.
Thanks a lot, already subscribed to your channel.
I am soo happy for such positive vibes
Keep learning and pls share as much as you can to support our channel
Hey can you please help me out,
While downloading mongoDB, a file named 'mongo.exe' has to be downloaded, which when i download it got downloaded with the name 'mongo' only.
When I'm trying to connect mongoDB server with node.js server, it is not gteting connected.
Is this issue came coz of not downloding 'mongo.exe' file properly ?
maza aagya bhaiya !! great lecture
Ek number bhai easy to learn and understand aapne bataya he 👍
Bro can you plz. share notes
Thank you very much Sir for making such lecture deep explaination along with notes and Error handling better than many paid courses hats of you Sir dil se Shhukriya 🤍
Bass bhai share kardo jitna kar sakte ho
Thank you bhaiya 💙🎉
Thank you bhaiya... learned a lot
crazy playlist sir !!!!!
best
explaination
ever
Good explanation 👏 👍
Wonderful Video sir🙏🙇♂✨💖
Definitely better bootcamp than a so called Udemy Course
Best video ❤
Really useful of me ❤
maja a gya bhaiya inta acha padhane ke liye dil se sukriya 🚀🚀🥰😘
Thanks a lot keep sharing my channel
Best bootcamp for beginners
successfully done 🙂
Amazing!!!!!!!!!!!!!!!!!!!!!!!!!!
You deserve more subscribers brother. Thanks for your service❤
thanks brother good videos
Great lecture sir🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
Thanks
Excellent!!
Many thanks!
Thank you so much
Your the best🌟🌟🌟🌟🌟
badhiya!!!!!
Jo aapne postman me person data likha tha / laga ke jisme name and other details likhi thi wo kaha pe bana ke rakha tha ??.uska koi folder ni dikha ?jaise idli sambhar wala data to banaya tha ek folder me par ye wala ni dikha kaha banaya?
Thank you sir ji
You are great
So nice of you
best for beginner
Thank you sir
thanku bhai
thank you vaiya for such a great bakcend bootcamp !!!! maja a gya
At 12:42 is it command prompt?. My community server is not starting.
Thankyou sir
Yes sir ❤
Bhai sidha atlas ya compas se bhi to link leke database se connect kar sakte h na i am beginner isliye puch ra hu
good same like 3L course
thank you so much bhaiya
Always welcome
best content
For windows, mongodb is disconnected using db.adminCommand({shutdown: 1, force: true})
And reconnected using by running "services.msc" on cmd and start mongodb server.
Bro can you plz. share notes
Wow when i am able to do the first entry in the db i am so happy
Bro can you plz. share notes
@@2719yash i dont have notes. i dont make 'em i do practical hands on and if i feel something is really important i comment it out in my code
excellence
Thanks alot bro
Always welcome
Keep going 💪❤
Thanks 🔥
Can you tell the extensions you are using in VsCode
Present Sir #mongoose_schema #CRUD_operation #nodejs♥
nicee.....very good
Many many thanks
Maza aagaya prince bhai
Thanks yaar
Please share this channel
sir schema mobile type number hona chaiyeh na,string likha hai
great video
Thanks!
bhaiya baha pe humne as a Person model create kiya hai to people kaha se a gaya ye samjh nahi aya
Thanks sir g
Welcome
bhaiya ajay bhaiya ke channel nhi mil rha kya hai name plz🙏🙏
Can i use .then() and .catch() to handle asynchronous functions . what should i prefer async await or .then().catch()
you should prefer async await beacuse of code readability and less code syntax
you can use both but modern mern developers use async/await as per industry standards.
bhaiya I think in new verson of node useNewUrlParser is not necessary
Thanks bro
Any time
Mongodb server is not connecting ?
very nice video
Thanks
#reallearning 🔥
Dear sir, I am Zohair Faruqi from Karachi, Pakistan I would like to say that your course is very helpful for those whose beginners.
Most of the students are overseas , kindly to give free link for your foreigner students , they need notes too , for follow your course.
Because foreigners have not any payment method. Kindly understand most of the students problems.
Thanks
Zohair Faruqi
where can i get these notes
thanks
Good luck!
how to disconnect the mongodb in window any body answer please
Keep It Up Good Work ❤
sir can you please provide the notes
Bhaiya mongoose ko Nodejs server se connect karne pe error aa raha hai please help me
Bhaiya Love from Nepal❤ Your teaching style is awesome
Bhaiya I have one doubt
In GET method, menu Ka port 3001 mey hogaya but 3000 mey he menu +person Ka nahe hora hey why?
on event not working, please solution
🔥🔥🔥🔥
Bhaiya ye pluralization ka error solve nhi ho rha pls help 2 din se lagi hu ise solve krne me lekin nhi ho rha or ye connection wala message bhi aa rha terminal per
hotels kaha pe define kiya tha?
help.. mre m mongoose connected hi n aa rha h server is running tk aa rha h uske baad error aa rha h
🔥🔥🔥🔥🔥🔥
Hii Bhaiya ,
Database me people name ka collection kaise bana humne toh use code me kahi mention nahi kiya tha ...??
please reply
got the answer person plural is people 😊
Simplified explanation
run hi nahi ho pa rha h code
error while connecting to the database
bhaiya async await to samajh me aagya
const savedPerson = await newPerson.save()
but ye .save() kya h isse apne aap save ho jata h kya ?
Haan ye mongodb ka khud ka function hai
vaiya sab to thik hei but database me people name se kyu aya...hum tp person naam se banaya tha module...
Ajay bhaiya ka channel kaun sa hai sir ji?
sir for pratice notes problem can we get soln? if we hv doubt
Yes it has solutions as well
my server.js file is throwing errors and not getting connected to mongoDB @11:42. On terminal it shows server is listening on port 3000 and then throws an error and nodemon gets crashed.
whats ERROR
?
thik hua?
mera bhi yahi bta rha h same
This error typically occurs when you're using an outdated or incorrect option name. The correct option name is useUnifiedTopology, not useunifiedtoplogy.
Please create frontend(react.js) playlist it would be very helpful for us.
Sir server toh connect ho ja raha hai but database nahi ho raha node js se connect , db.on mai error aa raha hai ,,,,, plssssssss helpppp