User and video model with hooks and JWT
ฝัง
- เผยแพร่เมื่อ 21 ต.ค. 2024
- 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/hit...
Sara code yaha milta h
github.com/hit...
WhatsApp pe yaha paaye jaate h:
hitesh.ai/what...
Discord pe yaha paaye jaate h:
hitesh.ai/discord
Instagram pe yaha paaye jaate h:
/ hiteshchoudharyofficial
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!!
Yes he has missed
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
This course sets benchmark standards 😁😁
and that too in free of cost ♡
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.
who ever missed this video I am telling you every minute of this video have years of knowledge. Its a must watch guys 🤩
bhai ye authenticatrion ka km he na jo sir jwt se kra rahe isko alag folder bh krtey he?
@@Zaid__1__9 kehne ka matlab
@@hellome3046 means k token jo gneerate hore usse pehle jo pre hook lagaya he passwor wala wo authenticate kab hoga
Best JavaScript channel on TH-cam. Love from Pakistan ❤
bhai tumne javascript channel likh kr sir ko naraz krdia hai😂
@@technologymad9253 😆😂
@@technologymad9253why but ?
Not only javascript sare playlist gem hai
wo to hai 👌👌
Best Nodejs Express backend course in TH-cam. This is called learning === enjoying
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❤❤❤
❤❤❤❤❤
Again, watching this playlist to revise the concepts would say, still one of the best backend series. Thanks sir for this series. Would love to get more videos of this series.
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 💓
Thank you so much 😀
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.✌
I am a Govt Officer , learning coading past one year. Your teaching is amezing. Learn a lot from your English channel also
Sir ab aap bhi hamara competition badhaoge
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 🧿
6:30 User Model
15:15 Video model
20:20 Mongoose-aggregate-paginate-V2 package discussion
23:50 bcrypt and jwt token
On 9-1-2024, I watched this video. It's the best and most in-depth course I've ever seen. The way you teach and practice Mongoose is amazing-I love it. I've been a Laravel developer for the last two years, and I want to shift my career to JavaScript. Choosing your channel to learn the MERN stack was the best decision of my life. Love from Pakistan. ❤
I took paid courses but they never discuss a single word on aggregation in MongoDB.
Thank you sir for being best of the best ❤
will complete this series for sure. learning alot daily😍
Learning from teacher like you such a blessing 😊😊 THANK YOU SIR !!!
Bhai bohot he khobsorathe sa samjatha ha ap na.
Hud kar de ap na. Ap jasa pharhana Wala teacher aj thak nahi daka.
Bohot sari Dua ap k liya.
Love from Peshawar, Pakistan 🇵🇰💚
I follow all the FrontEnd and Backend series and got an amazing experience
Now I am preparing SD3 lavel
Thanks sir
The way you teach with so much love is just awesome sir. Such professional approach to backend is not available in the whole TH-cam community. Love you sir and thank you for providing such beautiful content absolutely for free. ❤❤
7:45 it will be saved as "users"(mongoDB saves model names in lowercase and appends character 's' makes it plural).
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.
Comment contribution 😁🙏🏼
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
1k comments done
who ever missed this video I am telling you every minute of this video have years of knowledge. Its a must watch guys
*895 Comments Done
Thaks a lot Hitesh sir , the price of this course can be in lakhs , the quality of content is literally superb. Once again thank you so much.
I hope hitesh sees this comment. thanks hitesh, this knowledge is very hard to get but you are teaching it in free of cost. as fresher we struggle to understant the flow of application but can not able to understant specially when we work in MNCs.
sir, you are great, literally very nice series , nobody will overtake this series in youtube. I am giving 10/10 of this series.
Hitesh Sir Always Talking in dept of everything, That's why i follow him from last 2 years.🥰
sir aap sahi me bhot jyada acha educational content provide kr rahe ho mai aapko 2018 se follow kr rha hu
Best JavaScript channel on TH-cam
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 😊😊🙏🙏
Story Story me Backend learn ho jaata hai Thank you so much Sir
i am sure this is the best course i have seen in youtube
thankyou sir
SIr you're literally a one-stop solution for any concept ...
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
your videos are much needed even for experienced developers
thanks for your contribution
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 TH-cam channel out there who just teach stuffs want people want to learn. But their real world applications are very less.
We are very lucky to have this quality content for absolutely free ! Thanks Guruji .. 😊
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.
Hat's off sir. Jo kuch vi backend seekh rahe hai aap hi se
Iam using these videos with chatgpt and documentation and chai and javascript series .. deadly combination for learning
Thanks sir and his team
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
Hitesh you do a nice job, keep it up. Good wishes for you
The best back end course ever, thanks for ur hard work.
Best teacher and mentor ever😊
Best backend playlist 🥰 Love from Bangladesh
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
Your production-level teaching is Great ❤
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 🙏🙌
Sir great content lifesaver for my current job
So much info in just one video. Its a GoldMine
You can bank on this person for building a successful tech career, that's for sure. GOD level content.
sit your content is really very good beside your backend playlist i can find any good backend series
thanks sir, superb explanation+cleared jwt implemetation+model mongoose logic 🙏 💐
Sir, we are with you. I have never read Backend with this level of depth.
(06:32) User Model
(09:30) Whenever you want to enable search field for any field just mark the index property as true for that field
(15:10) Video Model
(23:52) bcrypt and jsonwebtoken
(27:45) pre hook to encrypt data/payload
(37:30) jsonwebtoken(JWT)
Your hard work will pay off sir.
thanks dear hitesh sir for valueable content , comment target pura na ho aise ho hee nahi sakta ,
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!
Nice in-depth video sir. till now kuch samaj nhi aa raha hai as i m starting as a new bie but i hope aapki krupa se jaldi hi samaj jaunga.
sir aapke padhane k style ka main fan hu ❤❤
I watch so many english channel on web development because they are better then most of hindi channels but you are even better then those english channel and so down to earth
Thanks a lot Sir. Each and every minute of this video is so precious. Thank you for making our life easier and better. Hats Off
Thank you sir, the previous two videos data modelling were proven quite beneficial while building the models in this video
Thanks Sir for giving best course on youtube 🤔
Thank You Sir for giving so in much depth, joined the course late but enjoying a lot💖❤
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)
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......
i never understand so easily and got so curious ever best teacher on the planet
This series will change the way a beginner code 😎
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
bhot achha course hai sir dhanyawaad...
Best backend series thank you sir for providing this kind of content
One of the Best Explanation even I have seen. Thank u so much.
Thank you Sir aapki awaz bahut hi acchi hai
well explained and deep teaching..thankyou so much sir
Thank you for this course, hope this reaches new heights ❤❤
thanks for your series..
🥰
No matter how many times I see it, It inspires me more and more.
love from nepal
Great series on backend development
Recognizing Hitesh Sir's role in #chaiaurcode #backenddevelopment is commendable. Being grateful to teachers like him who shape our learning journeys is valuable.
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
Excellent teaching...... Looking forward to more...👍👍👍
sir this course is one of best backend course
Right Sir 😊 This Video is really set a Standard benchmark I appreciate..!!
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.
Best teacher award goes to hitesh sir.
Js se shuru kara tha
Ab kafi aage tk agaye hai aapke saath is web dev ke safar mai❤
This video clear my mongodb concept. Nice backend tutorial
Nice Tutorial For Backend
Best course of backend in the whole world
As always, good.... finishing each video gives more satisfaction..!!
To export any schema the following is the syntax:
export const = mongoose.model ("same as schema name", schema ref);
love the way you teach " mongoose please ek model bana k dena" ♥🔥
This is Insane Sir Hats Off to Effort
outstanding video. thankyou boss. BEST IN INDUSTRY
Sir bdhiya mza ara hai aap lge rhe aise hi hum bhi support dikhate rhenge❤
Very nice video. Explained this topic in depth