Writing update controllers for user | Backend with JS
Вставка
- Опубліковано 10 лют 2025
- Visit chaicode.com for all related materials, community help, source code etc.
Welcome to chai aur code, a coding/programming dedicated channel in Hindi language. Now you can learn best of programming concepts with industry standard practical guide in Hindi language.
All source code is available at my Github account:
github.com/hit...
Our Open-Source Project is here: freeapi.app
Join me at whatsapp: hitesh.ai/what...
for community discord: hitesh.ai/discord
Instagram pe yaha paaye jaate h:
/ hiteshchoudharyofficial
HTML video series: • HTML and VSCode - gett...
Complete javascript series: • Javascript for beginne...
Complete Reactjs series: • React JS roadmap | cha...
Javascript and react interview series: • 1 call se shuru hui pl...
Backend development with Javascript: • Javascript Backend Roa...
Hitesh sir, saw your post on "Re thinking to backend series", sir please don't stop. I found only single channel on youtube who teaches amazing and in-depth. Many people are loving this series. Really looking after how professionally we build the complete project.
Hope that you will continue.
Thanks ♥
regarding what he said @14:10 he said if the user is able to change the password user must be logged-in which is true. then he said how he would be logged-in because middleware has been used. but at the time of logged that particular middleware(auth.middleware.js) has not been used. it was used just before logout as the code is "router.route("/logout").post(verifyJWT, logoutUser)" and here verifyJWT was exported from the middleware auth.middleware.js hence it was used just before logout. since until we are logged In and we have not proceed for log out we wont get this middleware.
Hitesh just saw your broadcast post "Re-thinking to continue backend". Please don't stop this series as it is really important for people like us who wish to do full stack (your react and this backend)... It's my humble request😢😢 I'm looking forward to how you integrate stripe payment and google oauth in production and how we secure and scale our backend.. Currently I'm doing your react series and keeping tap of your backend series (the titles and not watching them as of now). I will watch the series after I'm done with react. Again please don't stop😢😢 Just a small gratitude from my end. I hope this message will motivate you❤❤❤
Actually sir, we r not with the pace of the videos we r getting, I am lagging behind in learning., So at least me I am learning react then backend I will start and learn and finish it.
#chaiaurcode
@Aaayushgtm sorry shaktiman
Thanks! Bhaiya ji i am student at Surat. i love these videos this a small gift from my side happy Basant panchami ( Maa Sharaswati Pooja 🙏🙏🙏🙏) ❤❤❤❤
Don't stop this series , please we are learning alot form this backend series
pls don't stop uploading,
Pls complete this series.
mujhe ko dsa to bhut log padha denge.
But Backend development koi aap jaisa ni padha payega.
sir we seriously need development teacher like you❤.
No one can replace you, and also your benchmark quality content no one can even match.
I personally feel, Hume aap jaise development teacher ki need h jo hume help kre industry ready hone me❤.
Pls re think about this.
I hope you understand our situation❤.
Hume hindi me aisa development content sirf aap hi de sakte h❤.
pls stay on development mode.
i have completed javascript series . now i am in react . after it i wil come to backend . sir we assure you it will be one of top coding channel in upcoming days. stay motivated ! upload video fast till i complete and practice react . i will be ready for complete backend series😃😃😃😃
Hey bro are u complete beginner?....my concepts are clear in js but didn't know how to tackle interview questions of js any guide what I do to strong our js concepts?.
In ower IT filled you should learn any language in two different ways one four your understanding and second four interview :) believe yourself and just practice 15-20 day for interview only..🧑💻 you can do it
#chaiaurcode
@@itsYourType313right 👍
Sir, you are an amazing teacher. I am creating software for my startup by learning production-grade backend from this series. Pls not delay the videos
i dont think any series on youtube of backend comes even close to this series in backend this series delivers content that even paid courses find difficult
finding myself really fortunate to learn this type of content
just amazing and i heartly express my gratitude to guruji
Error = line 257 - .json(new ApiResponse(200, req.user, "User Fetched")). Very well explained sir! #chaiaurcode #backenddevelopment
Sir, after learning from you, the first thing I gained was confidence. Secondly, whenever I encounter other code, it consistently reminds me of the proper way it should be structured. I've seen significant improvement, and I owe it to your guidance. Big thank you!
I just wanted to take a moment to express my sincere gratitude for the incredible industrial knowledge you share on your channel. Your videos have been an invaluable resource for me, providing insights and understanding that I couldn't find elsewhere.
The way you break down complex industrial concepts and explain them in a clear and engaging manner is truly commendable. Your passion for the subject shines through, making learning not only informative but also enjoyable.
I appreciate the time and effort you invest in creating such high-quality content. It has made a significant impact on my understanding of Backend, and I look forward to each new video you release.
Thank you for being a guiding light in the realm of industrial knowledge. Your dedication to educating and empowering your audience does not go unnoticed.
u literally have made me an enthusiastic developer , skills can be learnt from anywhere but, to ignite the passion and interest in students should be the ultimate goal. highly grateful for your teachings
your series gives us more confidence on javascript. Thanks for all you are doing for us.
Hello 👋 Hitesh Sir,
I saw you broadcast post on whatsapp 'Re-thinking to continue backend'. 😮
This is my humble request please dont stop backend series. Currently I am at the ending of your JavaScript series & mid of react series That's why unable to watch Backend series.
Please dont stop this series because here are lots of people who want to do full stack development like me.
maza gaya dekh ke. bohot dimaag khul gaya ki kaise user details ke controllers banaye. dil jeet liya❤
Please don't stop the series sir, it is very helpful for me, upload the video late it's alright but don't stop it, I'm learning so much from it
35:00 Sir in this function we should have deleted the old avatar from cloudinary also, those who are interested ask chatgpt about it and you can add it on you own in the cloudinary file
// add this func to cloudinary
const deleteFromCloudinary = async (publicIdOfFile) => {
await cloudinary.uploader.destroy(publicId, (error, result) => {
if (error) {
throw new ApiError(
500,
"existing file could not be deleted from cloudinary"
);
}
});
};
dont forget to export it
Hey I also noticed that, but how to get publicID of the file we want to delete as we only have the url of the images?
@@sameerraj5800 we need to store publicID of images during registration.
How to get public I'd automatically
Don't say use : response.public_id
Please don't stop this series... Currently I'm doing an internship so I'm not getting much time but I'm planning to complete this series to become a full stack developer.
Please keep it coming.
Unique series on UA-cam in Backend development
Your teaching style goes beyond the conventional. You don't just educate; you inspire curiosity and create a framework for effective teaching. Every teacher should adopt your teaching approach. Grateful for the unique perspective you bring to education!
Love form Bangladesh💝
Sir, I will say it is the number one channel for learning programming.
Amazing Video as always.
I am rewatching it second time.
I had to stop due to college, now that it's over, I am determined to finish the Course
Sir, Great video. All i want is to learn. Please be consistent again. Thanks a lot for this series.
Sir just seen your Whats app post that people aren’t watching this amazing series. I have also missed some due to wedding season. Next Christmas then new year. I think people will start watching and learning from this series once new year gets started.
thank you sir for this amaging indepth backend series ,really loving the way you are explaining every concepts in depth and is excited for the next upcoming videos
Awesome series, I have never encountered this level of production quality training in any course, Please keep it up
Sir is being consistent again, loving your backend content and always eager to learn more from you
@chaiaurcode just saw the message on your WhatsApp channel about continuing the backend series. I have recently completed the *Javascript* series & currently on *React* series. Please do not stop the backend series. Will watch the backend series after that. The content quality is unparalleled. We will try to support you in whatever way possible 🙏🏼🙏🏼
Very informative and helpful video. Able to visualise everything properly
Sir I can't thank you in my words. I feel so confident. There was a time when I was learning Frontend, I was low I was sad i believed that i'm not for programming I can't do programming. But this is me who is enjoying backend more than anything. You made backend this much easy jisse ki i fell in love with backend and with your channel. Bless me Teacher to have a great future ahead. Thanks a lot again!
I have to say Hitesh sir is gem our community ❤❤❤❤
Best lecture from best teacher 🎉🎉
Hi Hitesh Sir,
Each and every video of this channel is giving me more confidence
Thank you for your time making this videos
Glad to hear that 😃☕️🙏
Please dont leave this series in half way we want it hardly sir 🙏🙏 its like a forever guide for all of us
The best tutorial out there for backend in js. I already have experience in making full stack but this playlist is just clearing all the fog in my mind. THANKS A LOT HITESH SIR. YOU ARE TRULY A “TEACHER”.
We are waiting for next js series after completing this one
Sir, please continue this series. No playlist series videos on youtube has the same number of viewers for each video. After a year or so, you will see that this series will have a lot of views. Views for each subsequent video in a playlist tend to go down, even if it is a channel with 5 million subscribers. So please continue, this series is very helpful
sir in production mysql database is preferred as mongodb in not scalable ? any thoughts when to use mysql data base and when to use mongodb database, because in mongodb we can also make relations my passing ref in the schemas and sql is already relational database. so why sql is preferred over mongodb.
Sir, you are great, I mean best thing I found on UA-cam is your channel
In mern stack only mangodb is been used or other RDBMS are also been mixed up in production practice? Love from Nepal.
Database choice depends on the company you're working for, in case of relational databases you should use an ODM like sequelize
Lot of open source code bases use SQL database a lot
This series is great. Such comprehensive and detailed explanation of every concept. It really gives a unique perspective of developing backend for real world applications.
Thankful for such great teaching, Hitesh sir.
🙋♂
Hamesha "7:30 PM" par kyun?🤔
Lagta hai sir bhi "Taarak mehta ka ulta chashma" dekhte hain! 😂🤣🤣
Love you sirr ,❤ Mene kavi paid course nehi liya thaa , Aab pata chala ki Quality content kiya hote he , Aage app khabi vi paid course launce karenge toh me us course ka first 100th student mese ek rahunga , promise ❤, & Thank you again ❤❤🎉
"Your backend JavaScript tutorials are an absolute game-changer! 🚀 The way you break down complex concepts into easy-to-understand steps is a lifesaver for someone like me who's diving into backend development. Your clear explanations and hands-on examples make learning a joy, and I appreciate the depth you go into without overwhelming your audience. Keep up the fantastic work! 🙌 Looking forward to more enlightening content that turns backend development into a breeze!"
This Backend series is very Helpful and unique Thank you so much, sir
What an amazing journey so far. I learned so much in the comfort of my home.
5:08 arey sir ap itni mehnat se videos banaty hai to hum itny gor se q nahi dekhy gy thank you so much sir love from pak
Thanks sir for providing best backend series 😊
Hello Sir, I would like to thanks from the bottom of my heart , for making such a good backend series. I have not seen such type of videos on you-tube even not on paid course as well. thanks a lot once again Sir.
I am wondering, the level of energy and efforts you put in every video, can't stop myself from learning when I start watching your backend series
Database is on other continents ......
Sir maja aata hai Study krne me Thank you sir 🥰🥰🥰
34:09 Future developers sir is giving the best advice to keep this in your mind
Sir uptil now I have referred many yt channels for studying anything related to programming or cs but after visiting your channel through pw I almost stopped watching them. Through your courses I have explored many things which I couldn't do if I done this all by myself. Thank you sir for providing such a valueable content and also giving us a environment where we explore our understanding and learn only those concepts which are actually being used in the industries.
sir i really appreciate your work, and once again a very thanks for creating such resourceful content on backend ....👌👌👌👌
Never binged any series like this, Since I've implemented some of the stuffs in my previous projects so everything is clicking why I did that why that thing worked and all sorts of doubt is getting solved here😅😅🌸🌸
Sir,
Your are teaching style all the best than other UA-camr . That why I m waiting your video .
Thanks sir💙💙
Thankyou for the backend series. Learning alot of things.
Sir you are great teacher sir you are really heart touching for developers ❤
Sir please continue this series. It's amazing and we are learning a lot. 💯🙏🙏❤
Very helpful content sir! Understanding and learning a lot..it is also good that I can watch many videos in one go due to this series being already over...very grateful to you.
took a paid course to learn mern stack that too is a very good course but this is an extraordinary one . Maza hi agya bilkul. Concepts itna achese se clear hua + dimaag mein baith gya hai ki koi neend mein bhi bolega bhai ye kaisa work krta hai toh batadu
Literally i can bet paid courses ka koi match hi nhi iss course se
Before this series I was able to solve complex dsa problem but in backend I was just a cat, but now I just feel like a lion king, we really love ❤🔥❤🔥❤🔥 the way you teach
Finally caught up with the latest video in the series. Please continue with the series and thanks!
hahahaha , sir ji only commenting here because you caught me red-handed about watching this video while lying on my sofa! ek dum man-mugth kar dete ho aap sir loads of love...aur sir ji python complete aapne sikha hi diya hai , bas django bhi sikha do jaldi...chai ke saath
I can write controllers now.. thank you so much to this man❤
Thank you so much sir ❤
Sir, I appreciate your efforts to teach us in that depth and your teaching ability is on the next level. During watching this video, I think in the updateAccountDetails method, we should use && operator between fullName and email when we are checking it to be not null. Thanks🙂
Your videos are very easy to understand and are very practical
31:14 To update avatar
Step 1: get avatar from user
Step 2: find user with the id from req.user
Step 3: upload avatar to cloudinary
Step 4: Save avatarUrl to database
Step 5: Send success response
Bug: : Line 267 __ missed 'await' keyword ❤❤❤ while finding the user and update user details.... , love you sir ❣️❣️❣️❣️🎉 don't discontinue this series ❣️❣️
Learning by myself after watching this video is a major benefit I found.
Hi hitesh sir, each and every video is giving me more & more confidence before your channel I thinked that coding is not for me but now I'm realizing that i can be aa good developer.
Journey of being professional continues and you are the pilot 🚁. Thank you for this amazing content. Hope to meet you soon sir❤
First I watch this video and then write all of the endpoint feel confident ❤
Thanks sir❤️,
We need This type of professional projects/learning more.
Sir sabse jaysa reset & forgot password me hoti hai , but ab aapki video aagai to ab sab kr lenge❤❤
this series is absolutely amazing!!! thanks Hitesh sir
Thanks!
Sir don't stop the backend series, we are very impressed with the previous videos and will continue to show love, but to understand the previous concept we are rewatching the previous videos that's why new videos doesn't have that much engagement, 🙏🏻 we are trying our best to complete previous lecture as soon as possible and give love to new lecture, hope you understand ❤, lot's of love
Thanks a lot Hitesh sir.....
For giving these amazing video clear my all doubts After watched these video....sir ❤
Sir please continue this full series, we need this awesome content.
Superb Video on refresh access token 😍
1. Think use case like single user can have multiple channels. 5:00
2. findByIdAndUpdate will not word for password change and hash the password. Because findByIdAndUpdate calls the middleware findOneAndUpdate which does not execute pre and post save hooks. 13:16
3.
Amazing, Totally Professional.
19:58
one more validation we can put is to check whether the old-password and the new-password is equal or not, if we found same than we need to throw error else we can move ahead.
Great tutor ever all over the youtube developer community
follwing this series ,i realized how complex and hard task is to desgin ,scale a website with a scale to youtbe ,facebook.
Im learning frontend .....but just for you sir.....❤❤
Thanks
Thanks for the video.
please bring more fire backend videos
🔥
great teacher comes with great videos 😊
this level of explanation is amazing.
great instructor with great knowlege ..
Sir Please continue to make this kind of amazing series, these are like text book, in video form
Hey , i genuinely support you for you content from heart. keep going.
Please continue making videos in this series. My personal project depends on you.
Thank you sir for giving this much needed knowledge......how to develop user details management controller in depth
love it, sir, please continue this series we are learning a lot from it .
Continuing the Series again sir! Was busy with job interviews and examinations. Happy to say I got the Job sir, but still, I will grind more. ♥
#ChaiaurCode, one of the best teacher of youtube, thank you so much for your valuable time Sir❣
for updating avatar:
1)find the selected user and get avatar input
2)update the avatar in multer and reflect the link in database
3)send avatar updated response