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

ความคิดเห็น • 1.4K

  • @arghya_0802
    @arghya_0802 9 หลายเดือนก่อน +32

    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!!

    • @executioner943
      @executioner943 4 หลายเดือนก่อน

      Yes he has missed

  • @jaffasunny
    @jaffasunny 11 หลายเดือนก่อน +78

    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  11 หลายเดือนก่อน +51

      This course sets benchmark standards 😁😁

    • @bhaskarmoger1160
      @bhaskarmoger1160 7 หลายเดือนก่อน +5

      and that too in free of cost ♡

  • @uzairahmad7442
    @uzairahmad7442 8 หลายเดือนก่อน +20

    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.

  • @hamzasajid7973
    @hamzasajid7973 5 หลายเดือนก่อน +34

    who ever missed this video I am telling you every minute of this video have years of knowledge. Its a must watch guys 🤩

    • @Zaid__1__9
      @Zaid__1__9 หลายเดือนก่อน +1

      bhai ye authenticatrion ka km he na jo sir jwt se kra rahe isko alag folder bh krtey he?

    • @hellome3046
      @hellome3046 หลายเดือนก่อน

      @@Zaid__1__9 kehne ka matlab

    • @Zaid__1__9
      @Zaid__1__9 หลายเดือนก่อน

      @@hellome3046 means k token jo gneerate hore usse pehle jo pre hook lagaya he passwor wala wo authenticate kab hoga

  • @abubakardev3066
    @abubakardev3066 11 หลายเดือนก่อน +81

    Best JavaScript channel on TH-cam. Love from Pakistan ❤

    • @technologymad9253
      @technologymad9253 7 หลายเดือนก่อน +4

      bhai tumne javascript channel likh kr sir ko naraz krdia hai😂

    • @asmittyagi6250
      @asmittyagi6250 7 หลายเดือนก่อน +1

      @@technologymad9253 😆😂

    • @LearnerAbhi21
      @LearnerAbhi21 7 หลายเดือนก่อน +1

      @@technologymad9253why but ?

    • @tanishkagupta3479
      @tanishkagupta3479 6 หลายเดือนก่อน +1

      Not only javascript sare playlist gem hai

    • @developer_dhanji
      @developer_dhanji 5 หลายเดือนก่อน +1

      wo to hai 👌👌

  • @souravyadav2437
    @souravyadav2437 7 หลายเดือนก่อน +2

    Best Nodejs Express backend course in TH-cam. This is called learning === enjoying

  • @supersection
    @supersection 11 หลายเดือนก่อน +20

    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❤❤❤

  • @vivekbhatt3932
    @vivekbhatt3932 3 วันที่ผ่านมา

    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.

  • @kushagrakatiha
    @kushagrakatiha 11 หลายเดือนก่อน +13

    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  11 หลายเดือนก่อน +9

      Thank you so much 😀

  • @Dev-Phantom
    @Dev-Phantom 6 หลายเดือนก่อน +2

    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.✌

  • @sukamalpandit7009
    @sukamalpandit7009 11 หลายเดือนก่อน +9

    I am a Govt Officer , learning coading past one year. Your teaching is amezing. Learn a lot from your English channel also

    • @supremeleader5516
      @supremeleader5516 3 หลายเดือนก่อน

      Sir ab aap bhi hamara competition badhaoge

  • @Zerofactorial
    @Zerofactorial 8 หลายเดือนก่อน +2

    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 🧿

  • @Govindsingh_90
    @Govindsingh_90 11 หลายเดือนก่อน +18

    6:30 User Model
    15:15 Video model
    20:20 Mongoose-aggregate-paginate-V2 package discussion
    23:50 bcrypt and jwt token

  • @HassanAhmed-cb3gk
    @HassanAhmed-cb3gk หลายเดือนก่อน

    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. ❤

  • @shoaibhasan4026
    @shoaibhasan4026 11 หลายเดือนก่อน +7

    I took paid courses but they never discuss a single word on aggregation in MongoDB.
    Thank you sir for being best of the best ❤

  • @Trance-tales
    @Trance-tales 7 หลายเดือนก่อน +2

    will complete this series for sure. learning alot daily😍

  • @SurajGupta-ux2se
    @SurajGupta-ux2se 11 หลายเดือนก่อน +6

    Learning from teacher like you such a blessing 😊😊 THANK YOU SIR !!!

  • @iUmerFarooq
    @iUmerFarooq 2 หลายเดือนก่อน

    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 🇵🇰💚

  • @web_mechanics
    @web_mechanics 11 หลายเดือนก่อน +7

    I follow all the FrontEnd and Backend series and got an amazing experience
    Now I am preparing SD3 lavel
    Thanks sir

  • @himadriroy7980
    @himadriroy7980 2 หลายเดือนก่อน

    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. ❤❤

  • @gobicorner
    @gobicorner 11 หลายเดือนก่อน +8

    7:45 it will be saved as "users"(mongoDB saves model names in lowercase and appends character 's' makes it plural).

  • @dikshatiwari4802
    @dikshatiwari4802 7 หลายเดือนก่อน +1

    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.

  • @prabhatchandela3959
    @prabhatchandela3959 7 หลายเดือนก่อน +7

    Comment contribution 😁🙏🏼

  • @shivkojha
    @shivkojha 7 หลายเดือนก่อน +1

    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

  • @NarenderSingh-qo2dj
    @NarenderSingh-qo2dj 5 หลายเดือนก่อน +3

    1k comments done

  • @LetscookYummyrecpies
    @LetscookYummyrecpies 3 หลายเดือนก่อน

    who ever missed this video I am telling you every minute of this video have years of knowledge. Its a must watch guys

  • @Kashyap-1503
    @Kashyap-1503 7 หลายเดือนก่อน +4

    *895 Comments Done

  • @dheerajpali9746
    @dheerajpali9746 4 หลายเดือนก่อน

    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.

  • @swarajdevardekar8400
    @swarajdevardekar8400 4 หลายเดือนก่อน

    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.

  • @azeemdeveloper4815
    @azeemdeveloper4815 8 หลายเดือนก่อน

    sir, you are great, literally very nice series , nobody will overtake this series in youtube. I am giving 10/10 of this series.

  • @iamafnanhussain
    @iamafnanhussain 2 หลายเดือนก่อน

    Hitesh Sir Always Talking in dept of everything, That's why i follow him from last 2 years.🥰

  • @nitinduke
    @nitinduke 8 หลายเดือนก่อน

    sir aap sahi me bhot jyada acha educational content provide kr rahe ho mai aapko 2018 se follow kr rha hu

  • @kushanggharat3352
    @kushanggharat3352 8 วันที่ผ่านมา

    Best JavaScript channel on TH-cam

  • @RajCreationAA
    @RajCreationAA 8 หลายเดือนก่อน

    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 😊😊🙏🙏

  • @SongsetImage
    @SongsetImage 3 หลายเดือนก่อน +1

    Story Story me Backend learn ho jaata hai Thank you so much Sir

  • @romanthapa3673
    @romanthapa3673 3 หลายเดือนก่อน +1

    i am sure this is the best course i have seen in youtube

  • @lonewolf-_-8634
    @lonewolf-_-8634 5 หลายเดือนก่อน

    SIr you're literally a one-stop solution for any concept ...

  • @Ghatkars
    @Ghatkars 9 หลายเดือนก่อน

    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

  • @hustlers3918
    @hustlers3918 หลายเดือนก่อน

    your videos are much needed even for experienced developers
    thanks for your contribution

  • @mayukhdevansahu5707
    @mayukhdevansahu5707 11 หลายเดือนก่อน +2

    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.

  • @thegamesopener8114
    @thegamesopener8114 8 หลายเดือนก่อน

    We are very lucky to have this quality content for absolutely free ! Thanks Guruji .. 😊

  • @mohammadhanif3016
    @mohammadhanif3016 9 หลายเดือนก่อน +1

    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.

  • @Jack-of_All-Trades
    @Jack-of_All-Trades 9 หลายเดือนก่อน

    Hat's off sir. Jo kuch vi backend seekh rahe hai aap hi se

  • @mudrad1930
    @mudrad1930 9 หลายเดือนก่อน

    Iam using these videos with chatgpt and documentation and chai and javascript series .. deadly combination for learning
    Thanks sir and his team

  • @ItsHarsh18
    @ItsHarsh18 6 หลายเดือนก่อน

    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

  • @aamirpare
    @aamirpare 7 หลายเดือนก่อน +1

    Hitesh you do a nice job, keep it up. Good wishes for you

  • @kazitanim007
    @kazitanim007 7 หลายเดือนก่อน

    The best back end course ever, thanks for ur hard work.

  • @Khushi_Chauhan759
    @Khushi_Chauhan759 29 วันที่ผ่านมา

    Best teacher and mentor ever😊

  • @huraiah821
    @huraiah821 8 หลายเดือนก่อน +1

    Best backend playlist 🥰 Love from Bangladesh

  • @afzalhamdulay
    @afzalhamdulay 5 หลายเดือนก่อน

    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

  • @walidbaharwal
    @walidbaharwal 6 หลายเดือนก่อน

    Your production-level teaching is Great ❤

  • @roshanlalsahu7846
    @roshanlalsahu7846 9 หลายเดือนก่อน

    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 🙏🙌

  • @WellnessSimplified-e7b
    @WellnessSimplified-e7b 2 หลายเดือนก่อน

    Sir great content lifesaver for my current job

  • @supremeleader5516
    @supremeleader5516 3 หลายเดือนก่อน

    So much info in just one video. Its a GoldMine

  • @arijeetkonar4386
    @arijeetkonar4386 5 หลายเดือนก่อน

    You can bank on this person for building a successful tech career, that's for sure. GOD level content.

  • @ritik9424
    @ritik9424 2 หลายเดือนก่อน

    sit your content is really very good beside your backend playlist i can find any good backend series

  • @GAURAVSHARMA-ty8nm
    @GAURAVSHARMA-ty8nm 6 หลายเดือนก่อน

    thanks sir, superb explanation+cleared jwt implemetation+model mongoose logic 🙏 💐

  • @vivekkrishan2198
    @vivekkrishan2198 9 หลายเดือนก่อน

    Sir, we are with you. I have never read Backend with this level of depth.

  • @themountains1701
    @themountains1701 2 หลายเดือนก่อน

    (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)

  • @tatariyaakhtar504
    @tatariyaakhtar504 7 หลายเดือนก่อน +1

    Your hard work will pay off sir.

  • @developer_dhanji
    @developer_dhanji 5 หลายเดือนก่อน

    thanks dear hitesh sir for valueable content , comment target pura na ho aise ho hee nahi sakta ,

  • @DevaMhatreAtBB
    @DevaMhatreAtBB 10 หลายเดือนก่อน +2

    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!

  • @WatchNotchK2S
    @WatchNotchK2S 3 หลายเดือนก่อน

    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.

  • @the_haryannvi_coder
    @the_haryannvi_coder 10 หลายเดือนก่อน

    sir aapke padhane k style ka main fan hu ❤❤

  • @ritikparihar9717
    @ritikparihar9717 8 หลายเดือนก่อน

    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

  • @rohanrajput2687
    @rohanrajput2687 18 วันที่ผ่านมา

    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

  • @harshalashi
    @harshalashi 8 หลายเดือนก่อน

    Thank you sir, the previous two videos data modelling were proven quite beneficial while building the models in this video

  • @RamSinghPatel-vs6ln
    @RamSinghPatel-vs6ln หลายเดือนก่อน

    Thanks Sir for giving best course on youtube 🤔

  • @arkadas2634
    @arkadas2634 6 หลายเดือนก่อน

    Thank You Sir for giving so in much depth, joined the course late but enjoying a lot💖❤

  • @ramannagwan8812
    @ramannagwan8812 8 หลายเดือนก่อน

    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)

  • @sangamgaikwad5021
    @sangamgaikwad5021 8 หลายเดือนก่อน

    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......

  • @sauravjha552
    @sauravjha552 8 หลายเดือนก่อน

    i never understand so easily and got so curious ever best teacher on the planet

  • @DeepakNamdev-i6m
    @DeepakNamdev-i6m 2 หลายเดือนก่อน

    This series will change the way a beginner code 😎

  • @codetv772
    @codetv772 9 หลายเดือนก่อน +1

    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

  • @kapil7008
    @kapil7008 5 หลายเดือนก่อน

    bhot achha course hai sir dhanyawaad...

  • @sandeeppal2045
    @sandeeppal2045 11 หลายเดือนก่อน

    Best backend series thank you sir for providing this kind of content

  • @gyanaranjansahoo6258
    @gyanaranjansahoo6258 11 หลายเดือนก่อน

    One of the Best Explanation even I have seen. Thank u so much.

  • @Spacefeild
    @Spacefeild หลายเดือนก่อน

    Thank you Sir aapki awaz bahut hi acchi hai

  • @rupaligupta4546
    @rupaligupta4546 6 หลายเดือนก่อน

    well explained and deep teaching..thankyou so much sir

  • @rohandavid305
    @rohandavid305 9 หลายเดือนก่อน

    Thank you for this course, hope this reaches new heights ❤❤

  • @rahulparajuli6556
    @rahulparajuli6556 11 หลายเดือนก่อน

    thanks for your series..
    🥰
    No matter how many times I see it, It inspires me more and more.
    love from nepal

  • @NeerajShukla-t8n
    @NeerajShukla-t8n 4 หลายเดือนก่อน +1

    Great series on backend development

  • @saurabhjaykar1603
    @saurabhjaykar1603 9 หลายเดือนก่อน

    Recognizing Hitesh Sir's role in #chaiaurcode #backenddevelopment is commendable. Being grateful to teachers like him who shape our learning journeys is valuable.

  • @SarveshKumar-08
    @SarveshKumar-08 11 หลายเดือนก่อน +2

    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

  • @mysterious_billionaire
    @mysterious_billionaire 4 หลายเดือนก่อน

    Excellent teaching...... Looking forward to more...👍👍👍

  • @MaHesH-bc1gn
    @MaHesH-bc1gn 7 หลายเดือนก่อน

    sir this course is one of best backend course

  • @codebyprince4562
    @codebyprince4562 8 หลายเดือนก่อน

    Right Sir 😊 This Video is really set a Standard benchmark I appreciate..!!

  • @K_EE_Koshal
    @K_EE_Koshal 9 หลายเดือนก่อน

    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.

  • @Raw_Matter
    @Raw_Matter 3 หลายเดือนก่อน

    Best teacher award goes to hitesh sir.

  • @vaibhavverma6813
    @vaibhavverma6813 8 หลายเดือนก่อน

    Js se shuru kara tha
    Ab kafi aage tk agaye hai aapke saath is web dev ke safar mai❤

  • @UttamPun-tz4fo
    @UttamPun-tz4fo 10 หลายเดือนก่อน

    This video clear my mongodb concept. Nice backend tutorial

  • @NoraizAmeen
    @NoraizAmeen 4 หลายเดือนก่อน +1

    Nice Tutorial For Backend

  • @ashunegi358
    @ashunegi358 6 หลายเดือนก่อน

    Best course of backend in the whole world

  • @FebinAugustine
    @FebinAugustine 7 หลายเดือนก่อน

    As always, good.... finishing each video gives more satisfaction..!!

  • @souravmandal3868
    @souravmandal3868 8 หลายเดือนก่อน

    To export any schema the following is the syntax:
    export const = mongoose.model ("same as schema name", schema ref);

  • @nikksanirudh
    @nikksanirudh หลายเดือนก่อน

    love the way you teach " mongoose please ek model bana k dena" ♥🔥

  • @AyushTiwari-h1l
    @AyushTiwari-h1l 11 หลายเดือนก่อน

    This is Insane Sir Hats Off to Effort

  • @rudra9535
    @rudra9535 4 หลายเดือนก่อน

    outstanding video. thankyou boss. BEST IN INDUSTRY

  • @devanand4269
    @devanand4269 10 หลายเดือนก่อน

    Sir bdhiya mza ara hai aap lge rhe aise hi hum bhi support dikhate rhenge❤

  • @abhisshekbhatti6830
    @abhisshekbhatti6830 หลายเดือนก่อน

    Very nice video. Explained this topic in depth