User and video model with hooks and JWT

  Рет қаралды 62,365

Chai aur Code

Chai aur Code

6 ай бұрын

Visit chaicode.com for all related materials, community help, source code etc.
Learn about hooks an d JWT in backend development in javascript for our MERN project
github.com/hiteshchoudhary/ch...
Sara code yaha milta h
github.com/hiteshchoudhary/
WhatsApp pe yaha paaye jaate h:
hitesh.ai/whatsapp
Discord pe yaha paaye jaate h:
hitesh.ai/discord
Instagram pe yaha paaye jaate h:
/ hiteshchoudharyofficial

Пікірлер: 1 100
@arghya_0802
@arghya_0802 4 ай бұрын
7:13 - Syntax for exporting: export const User = mongoose.model("User", userSchema) ; 7:46 - The model will be named as users [Plural and Smallcase] and that's why we always name the Model in UpperCase and Singular 12:40 - Next Line after type: mongoose.Schema.Types.objectId is - ref: "Video" 15:45: Syntax: export const Video = mongoose.model("Video", videoSchema") ; Note - I think sir had missed using await keyword in bcrypt functionality The lecture is just awesome!! Never understood JWT & Hooks in such a simplistic manner!!
@jaffasunny
@jaffasunny 6 ай бұрын
Never thought we can write methods directly into our schema, So much efforts have gone into this course, So many goodies one can take out from this course. Mad props to Sire Hitesh Chaudhary
@chaiaurcode
@chaiaurcode 6 ай бұрын
This course sets benchmark standards 😁😁
@bhaskarmoger1160
@bhaskarmoger1160 2 ай бұрын
and that too in free of cost ♡
@hamzasajid7973
@hamzasajid7973 4 күн бұрын
who ever missed this video I am telling you every minute of this video have years of knowledge. Its a must watch guys 🤩
@Govindsingh_90
@Govindsingh_90 6 ай бұрын
6:30 User Model 15:15 Video model 20:20 Mongoose-aggregate-paginate-V2 package discussion 23:50 bcrypt and jwt token
@abubakardev3066
@abubakardev3066 6 ай бұрын
Best JavaScript channel on KZbin. Love from Pakistan ❤
@technologymad9253
@technologymad9253 2 ай бұрын
bhai tumne javascript channel likh kr sir ko naraz krdia hai😂
@asmittyagi6250
@asmittyagi6250 2 ай бұрын
@@technologymad9253 😆😂
@beinglearnerabhi
@beinglearnerabhi 2 ай бұрын
@@technologymad9253why but ?
@tanishkagupta3479
@tanishkagupta3479 Ай бұрын
Not only javascript sare playlist gem hai
@developer_dhanji
@developer_dhanji 25 күн бұрын
wo to hai 👌👌
@uzairahmad7442
@uzairahmad7442 3 ай бұрын
Sir ! You have taught me and my younger sister a lot. we have a huge respect for you. whenever she calles me to ask something we mostly ended up saying your dialogue "Or to kia hi ha is me" . every video you make i really a great effort. This effort can only be seen if someone had worked in industry or really had suffered to solve many problems. Respect form Pakistan.
@sukamalpandit7009
@sukamalpandit7009 6 ай бұрын
I am a Govt Officer , learning coading past one year. Your teaching is amezing. Learn a lot from your English channel also
@supersection
@supersection 6 ай бұрын
7:13 - for exporting the model we use the following line of code export const User = model("User", userSchema); Here, {model} is coming from "mongoose" And, "User" will be saved in database as 'users', because by default mongodb makes the name plural (all in lowercase) THANKS A LOT SIR❤❤❤
@akhandpratapsinghhbtu9622
@akhandpratapsinghhbtu9622 6 ай бұрын
❤❤❤❤❤
@gobicorner
@gobicorner 6 ай бұрын
7:45 it will be saved as "users"(mongoDB saves model names in lowercase and appends character 's' makes it plural).
@shoaibhasan4026
@shoaibhasan4026 6 ай бұрын
I took paid courses but they never discuss a single word on aggregation in MongoDB. Thank you sir for being best of the best ❤
@kushagrakatiha
@kushagrakatiha 6 ай бұрын
3 hrs me to nhi kr paya.......but I loved this video the way you explain sir....is just amazing, a big heart from my side sir 💓
@chaiaurcode
@chaiaurcode 6 ай бұрын
Thank you so much 😀
@Zerofactorial
@Zerofactorial 3 ай бұрын
3 saal phale apko ek news channel mein dekha tha then pichhle saal pata chala ke mera bada bhai bhe apko follow kerta h kyu ke ushne bhaut recommend kiya ek teacher h yt pr must follow ker and aab 3 months ho chuke h "hn ji swagat h apka chai or code mein " ❤ thankyou so much sir confidence build kerne ke liye hamara 🧿
@SurajGupta-ux2se
@SurajGupta-ux2se 6 ай бұрын
Learning from teacher like you such a blessing 😊😊 THANK YOU SIR !!!
@DeepakYadav-bz3lh
@DeepakYadav-bz3lh 6 ай бұрын
I follow all the FrontEnd and Backend series and got an amazing experience Now I am preparing SD3 lavel Thanks sir
@user-pq1ro4dx1m
@user-pq1ro4dx1m 3 ай бұрын
Being a Java resource & enthusiast all along, I can relate as in how professional backend development is done, what industry approach & standards are. This is just excellent teaching & pure handwork from Hitesh's end. After a decade full experience in the industry , It feels great to be a student all over again with new programming language.
@Dev-Phantom
@Dev-Phantom Ай бұрын
These videos are Really "Top-notch" and better than any paid course. Fully production Level. Sir you are really putting so much effort. This is great work. Philanthropy for betterment Hindi speaking Software Developers. Thank you so much.✌
@Kashyap-1503
@Kashyap-1503 2 ай бұрын
*895 Comments Done
@raviegupta2849
@raviegupta2849 23 күн бұрын
7:10 - export syntax: export const User = mongoose.model("User", userSchema) 7:40 - In mongoDB "User" will save like :- users (all lowercase with plural, automatically done by mongoDB)
@souravyadav2437
@souravyadav2437 2 ай бұрын
Best Nodejs Express backend course in KZbin. This is called learning === enjoying
@codetv772
@codetv772 4 ай бұрын
20:17 "dusre model se kuch liya" iske baad jo aggregate wala part hai wo importamt hai -> isse aggregation query likh skte hai 37:43 jwt is bearer token -> jiske pass lathi uske pass bhais
@dikshatiwari4802
@dikshatiwari4802 2 ай бұрын
Thank you sir, , You have explained these complex topics in a way, i find it easy as well interesting. Your way of explaining topics is top-notch. I wanted to learn these topics but didn't find any video until i started this series. Thank you Sir for this valuable content.
@anonyone8834
@anonyone8834 6 ай бұрын
15:47 full template of any model-> import {model, Schema} from "mongoose"; const videoSchemaObject = {} const videoSchema = new Schema(videoSchemaObject,{timestamps: true}) export const Video = model('Video',videoSchema)
@shivkojha
@shivkojha 2 ай бұрын
I am binge watching also loving this series, retaining via practicing the stuff at same time so that not go in tutorial hell and squeeze as much knowledge as i can take from this series , beautifully explained every topic. Completed - 9/Mar/2024 6:15 pm
@walidbaharwal
@walidbaharwal Ай бұрын
Your production-level teaching is Great ❤
@funWithCode11
@funWithCode11 2 ай бұрын
Pahle humlog ek constructor banate the "const userSchema = new mongoose.Schema({ all mode code write here.}, {timestamps: true}) "and export karte the "export const User = mongoose.modal("User") abhi apne import mongoose {Schema} from mongoose se spread kar diya schema ko. Aur haa hamare database me ye save hoga "users" with pulural name ke sath.
@azeemdeveloper4815
@azeemdeveloper4815 3 ай бұрын
sir, you are great, literally very nice series , nobody will overtake this series in youtube. I am giving 10/10 of this series.
@CodeDaily365Days
@CodeDaily365Days 26 күн бұрын
7:10 export {User}
@saurabhjaykar1603
@saurabhjaykar1603 5 ай бұрын
Recognizing Hitesh Sir's role in #chaiaurcode #backenddevelopment is commendable. Being grateful to teachers like him who shape our learning journeys is valuable.
@K_EE_Koshal
@K_EE_Koshal 5 ай бұрын
It's wonderful that you recognize and appreciate Hitesh Sir's contributions to #chaiaurcode #backenddevelopment. Expressing gratitude to those who have positively impacted our lives is always a meaningful gesture.
@DTALKS01
@DTALKS01 Ай бұрын
MONGODB ME VO USERSCHEMA = MODAL KA NAME HO JAYEGA YE ----> "users" love you 3000 sir
@mayukhdevansahu5707
@mayukhdevansahu5707 6 ай бұрын
Damn! It's been years now I've been learning from your channel Hitesh Choudhary. Now this chai and code!!! Since the day one I had the same question in my mind, "Why this channel is so underrated?". But the way this channel is picking up speed, it's not gonna be underrated anymore ❤... Superb content, best teaching style, with real world examples. I've been in this software industry since years now, And I understand whatever you're teaching is actually worth it. Lots if KZbin channel out there who just teach stuffs want people want to learn. But their real world applications are very less.
@roshanlalsahu7846
@roshanlalsahu7846 5 ай бұрын
great video Hitesh, really loving the course. I am frontend dev, i was planning to learn BE from long time, but never found something which was this detailed and very well explained. Thanks for making the video. i have something to learn daily now, after a long time 🙏🙌
@lonewolf-_-8634
@lonewolf-_-8634 23 күн бұрын
SIr you're literally a one-stop solution for any concept ...
@FebinAugustine
@FebinAugustine 2 ай бұрын
As always, good.... finishing each video gives more satisfaction..!!
@DevaMhatreAtBB
@DevaMhatreAtBB 5 ай бұрын
I wasn't aware that, we can write this much of code in our *model.js* file! This will definitely help me in my next job project on the backend & I think after completing this course I can also go for Backend development, as currently I am working on React/NextJs ... #ThanksALotHitesh for making us a full-proof Full-Stack Developer!
@abhinavsalar5017
@abhinavsalar5017 6 ай бұрын
Again an awesome lecture. Today I get to know about some plugins - aggregation and middlewares, hooks used in mongoose.
@mohammadhanif3016
@mohammadhanif3016 4 ай бұрын
Your eloquence is truly remarkable, sir. You have delivered precisely as promised. The caliber of this series is undeniably exceptional, and attempting to articulate its essence feels insufficient-experiencing it is imperative. I consider myself fortunate to have a mentor of your caliber and eagerly anticipate further opportunities to learn from your expertise.
@nitinduke
@nitinduke 3 ай бұрын
sir aap sahi me bhot jyada acha educational content provide kr rahe ho mai aapko 2018 se follow kr rha hu
@rohandavid305
@rohandavid305 4 ай бұрын
Thank you for this course, hope this reaches new heights ❤❤
@aditya_kanu
@aditya_kanu 6 ай бұрын
34:55 small correction this.password = await bcrypt.hash(this.password, 10) sir missed await there so make sure to write that
@afzalhamdulay
@afzalhamdulay 6 күн бұрын
the code that you taught were never known to me. never saw this code. thats really amazing knowledge. although it was a bit difficult. especially the jwt part. have to give some time to it and watch the next lecture to see how jwt actually works. thanks a lot
@107-jerrybritto5
@107-jerrybritto5 6 ай бұрын
Thank you Hitesh sir before seeing your video I tried understanding the use of bcrypt and jwt but I couldn't understand it very well but after watching your video I understood it very nicely
@user-zs6gb6bs9n
@user-zs6gb6bs9n 4 ай бұрын
best video ever. mere company ne muze java basis pe hire kiya and node pe assign kiya and muze node and js ka 0 knowledge hai but apke videos dekh ke muze ab bohot topics ate hai sir wo bhi confidence ke sath because mere concepts clear ho rahe hai. thank you sir
@kazitanim007
@kazitanim007 2 ай бұрын
The best back end course ever, thanks for ur hard work.
@thegamesopener8114
@thegamesopener8114 3 ай бұрын
We are very lucky to have this quality content for absolutely free ! Thanks Guruji .. 😊
@Trance-tales
@Trance-tales 2 ай бұрын
will complete this series for sure. learning alot daily😍
@tatariyaakhtar504
@tatariyaakhtar504 2 ай бұрын
Your hard work will pay off sir.
@Codewithrasheed
@Codewithrasheed 6 ай бұрын
Sir Your Way of explaining is Best all concepts are cleared ❤
@user-in5yf1db3o
@user-in5yf1db3o 6 ай бұрын
Great personality... Great way of teaching❤
@huraiah821
@huraiah821 4 ай бұрын
Best backend playlist 🥰 Love from Bangladesh
@GAURAVSHARMA-ty8nm
@GAURAVSHARMA-ty8nm Ай бұрын
thanks sir, superb explanation+cleared jwt implemetation+model mongoose logic 🙏 💐
@ramannagwan8812
@ramannagwan8812 3 ай бұрын
7:13 - for exporting the model we use the following line of code export const User = model("User", userSchema); Here, {model} is coming from "mongoose" And, "User" will be saved in database as 'users', because by default mongodb makes the name plural (all in lowercase)
@mudrad1930
@mudrad1930 4 ай бұрын
Iam using these videos with chatgpt and documentation and chai and javascript series .. deadly combination for learning Thanks sir and his team
@prabhatchandela3959
@prabhatchandela3959 2 ай бұрын
7:43 'users' in database 😁
@rohit64bit
@rohit64bit 6 ай бұрын
This video changed my whole perspective of writing db models
@harshalashi
@harshalashi 3 ай бұрын
Thank you sir, the previous two videos data modelling were proven quite beneficial while building the models in this video
@arkadas2634
@arkadas2634 Ай бұрын
Thank You Sir for giving so in much depth, joined the course late but enjoying a lot💖❤
@afaqkhatri968
@afaqkhatri968 6 ай бұрын
Great personality... Great way of teaching..
@ItsHarsh18
@ItsHarsh18 Ай бұрын
sir i had a dilemma that ik the MERN stack since last 6 months but today got to know many things new ...didnt know v can write custom fn as well in MONGODB .. thank u sir ..for the first time m ever m commenting on someone's channel but honestly u made me do it .. hats off to u sir .will always be gr8ful for u
@developer_dhanji
@developer_dhanji 25 күн бұрын
thanks dear hitesh sir for valueable content , comment target pura na ho aise ho hee nahi sakta ,
@rupaligupta4546
@rupaligupta4546 Ай бұрын
well explained and deep teaching..thankyou so much sir
@RajSingh-cg2qj
@RajSingh-cg2qj 3 ай бұрын
best backend series, thankyou sir!!!
@user-el3dc8nx4m
@user-el3dc8nx4m 6 ай бұрын
This is Insane Sir Hats Off to Effort
@UttamPun-tz4fo
@UttamPun-tz4fo 5 ай бұрын
This video clear my mongodb concept. Nice backend tutorial
@asmittyagi6250
@asmittyagi6250 2 ай бұрын
7:42 "User" will become plural and lowercase --> "users"
@mdprogrammer6146
@mdprogrammer6146 6 ай бұрын
So production level knowledge. I have never seen such series ever before. 😎
@RajCreationAA
@RajCreationAA 3 ай бұрын
Sir i've seen some backend series but they only cover superficial topics, while you provide industry-level teaching an d also share best experiences, thank you so much sir for your this effort, currently i'm not earning but when ill crack the job i'll pay your fee sir 😊😊🙏🙏
@rahulparajuli6556
@rahulparajuli6556 6 ай бұрын
thanks for your series.. 🥰 No matter how many times I see it, It inspires me more and more. love from nepal
@sayandeep11
@sayandeep11 6 ай бұрын
One of the best channel on the history of KZbin ..Hitesh Sir is lit 🔥
@gyanaranjansahoo6258
@gyanaranjansahoo6258 6 ай бұрын
One of the Best Explanation even I have seen. Thank u so much.
@vikassahani2874
@vikassahani2874 6 ай бұрын
7:50 -> users ke name se save hoga mongodb atlas per
@ashutoshchoubey2901
@ashutoshchoubey2901 6 ай бұрын
❤......it's really vary grateful for us ki is tarah ka content mil pa rha h....really thanku sir...from the core of my heart .....
@Arindam0123
@Arindam0123 6 ай бұрын
Your experience is reflected in your videos.
@souravmandal3868
@souravmandal3868 3 ай бұрын
To export any schema the following is the syntax: export const = mongoose.model ("same as schema name", schema ref);
@mayukhdevansahu5707
@mayukhdevansahu5707 6 ай бұрын
Thanks for bringing such quality content on KZbin ❤
@allyn3015
@allyn3015 4 ай бұрын
Again you nailed it sir... Such an amazing content👌👌. Thank you for this type of content for free. Hope to meet you some day.
@waseemkan
@waseemkan 6 ай бұрын
Your teaching is so amazing🌹🥀 THANK YOU SIR !!!
@sandeeppal2045
@sandeeppal2045 6 ай бұрын
Best backend series thank you sir for providing this kind of content
@aamirpare
@aamirpare 2 ай бұрын
Hitesh you do a nice job, keep it up. Good wishes for you
@singhamita
@singhamita 15 күн бұрын
this is just an amazing quality content - Pure Platinum Standard !!
@wasimrajamiddya7560
@wasimrajamiddya7560 3 ай бұрын
Thank you for putting lot of efforts to make such kind of videos❤
@omjavir07
@omjavir07 6 ай бұрын
I wish your videos could've existed 2 years ago 🥲🥲
@akashpanda4492
@akashpanda4492 6 ай бұрын
Please bring this series fast sir.. This is one of the best
@kapil7008
@kapil7008 12 күн бұрын
bhot achha course hai sir dhanyawaad...
@kartikrajput2131
@kartikrajput2131 6 ай бұрын
very good bhai, new students ya fir freshers ke liye gold h ye
@sangamgaikwad5021
@sangamgaikwad5021 3 ай бұрын
sir u are making the awesome content for backend now i am very clear about how the JWT Token generating and also refresh Token thank u so much making this amazing content......
@vivekkrishan2198
@vivekkrishan2198 4 ай бұрын
Sir, we are with you. I have never read Backend with this level of depth.
@nexus2056
@nexus2056 6 ай бұрын
Amazing Sir! This is literally goldmine.!
@chetanpatil5925
@chetanpatil5925 6 ай бұрын
Thanks for teaching production level stuff❤
@shivamdubey8
@shivamdubey8 4 ай бұрын
Thanks a lot sir for this backend series.
@vipinishere9679
@vipinishere9679 6 ай бұрын
Your videos help a lot. Thank very much sir ❤😊
@poojalahane2584
@poojalahane2584 25 күн бұрын
THANK YOU SO MUCH BEFORE STARTING VIDEO 2-5-24
@codebyprince4562
@codebyprince4562 4 ай бұрын
Right Sir 😊 This Video is really set a Standard benchmark I appreciate..!!
@SarveshKumar-08
@SarveshKumar-08 6 ай бұрын
00:06 The video discusses the user and video models with hooks and JWT. 02:01 Creation of files and folders for models 06:15 Create User model and schema in Mongoose 08:06 User name field details 11:50 Watch history is an array used to store multiple values 13:42 The challenges of comparing an encrypted string in a user model 17:29 The video model requires the title, description, duration, Cloudy URL, and views. 19:26 Bullion flags are used to determine if a video should be sent or shown 22:58 Mongoose provides middlewares, plugin options, and aggregation framework for advanced querying. 24:40 Bcrypt library helps to hash passwords and ensure encrypted passwords 28:22 Hooks are used in the video to perform actions before saving data 29:59 Functions in the video are written in a way that includes encryption and takes time to process. 33:29 The logic checks if a field has been modified and performs actions accordingly 35:11 Understanding password encryption and comparison using Bcrypt library 38:44 Using JWT for authentication and token validation 40:33 Refresh token has a longer expiry than the access token. 44:12 Creating a payload with user information for JWT token signing. 45:59 Setting up access token and refreshing token for user authentication. 50:02 Next video introduces two seasons
@vedparmar319
@vedparmar319 6 ай бұрын
It was really good and i got some new ways of encryption Thank you very much
@muhammadubaid3800
@muhammadubaid3800 6 ай бұрын
Thank you sir for this extraordinary playlist of chai with backend
@arijeetkonar4386
@arijeetkonar4386 14 күн бұрын
You can bank on this person for building a successful tech career, that's for sure. GOD level content.
@user-vm7fe8fs6c
@user-vm7fe8fs6c 26 күн бұрын
great explanation in on nod js and best channel...
@AmrendraChaudhary43
@AmrendraChaudhary43 4 ай бұрын
Hitesh Sir's role in #chaiaurcode #backenddevelopment I have learnt Imgage upload via multer on Cloudniary and many more. Being grateful to teachers like him who shape our learning journeys is valuable. My favourite Access Token and Referesh token part was unbeatable #chaiaurcode 🙏🙏@HiteshChaudhary
@chaiaurcode
@chaiaurcode 4 ай бұрын
Thanks 😊☕️
@VJVYAS
@VJVYAS 5 ай бұрын
your content is very much appreciable , As always Thank you sir
How to upload file in backend | Multer
38:21
Chai aur Code
Рет қаралды 70 М.
The Ultimate MongoDB Aggregation Guide: Make Your Queries Soar in One Video
31:40
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 34 МЛН
Be kind🤝
00:22
ISSEI / いっせい
Рет қаралды 11 МЛН
WHY DOES SHE HAVE A REWARD? #youtubecreatorawards
00:41
Levsob
Рет қаралды 24 МЛН
JWT Authentication | Node JS and Express tutorials for Beginners
1:00:03
MVVM vs. MVI - Understand the Difference Once and for All
18:40
Philipp Lackner
Рет қаралды 26 М.
You might not need useEffect() ...
21:45
Academind
Рет қаралды 142 М.
JWT token vs Server Tokens
10:25
Hitesh Choudhary
Рет қаралды 24 М.
Custom api response and error handling | chai aur backend
46:55
Chai aur Code
Рет қаралды 81 М.
Kishori kuch Aisa - Radha Bhajan | slowed+reverb | Just Arpitz
13:37
Complete guide for router and controller with debugging
29:35
Chai aur Code
Рет қаралды 44 М.
DSA with Interview preparation course launch
19:54
Chai aur Code
Рет қаралды 17 М.
What Is JWT and Why Should You Use JWT
14:53
Web Dev Simplified
Рет қаралды 1,1 МЛН
Cat story: from hate to love! 😻 #cat #cute #kitten
0:40
Stocat
Рет қаралды 6 МЛН
又被抓住了,还好我机智
1:00
侠客红尘
Рет қаралды 70 МЛН
Essa MUSICA é Real ou Fake😱 #shorts
0:30
Lucan Pevidor
Рет қаралды 14 МЛН
Что случиться с парнем ? 😱
0:21
Pacan233
Рет қаралды 1,9 МЛН