NestJS with MongoDB & Mongoose - FULL BEGINNER TUTORIAL

Тәжірибелік нұсқаулар және стиль

Code: github.com/stuyy/nestjs-with-...
Support the Channel:
Become a Member: kzread.info...
Become a Patreon: / stuyy
Buy me a Coffee: ko-fi.com/anson
Donate on Streamlabs: streamlabs.com/ansondevacadem...
Donate on PayPal: paypal.me/ansonfoong
Connect with me:
Twitter: / ansonthedev
Discord: / discord
GitHub: github.com/stuyy
Twitch: / stuy
0:00 Introduction
1:00 Project Setup
2:00 Installing & Setting up Mongoose
6:34 Creating a Schema
11:50 Registering Schema
16:00 Injecting a Mongoose Model
26:00 Create & Save User to MongoDB
36:40 Get Data from DB
38:00 Get Data By ID
45:44 Update Data in DB
1:02:00 Delete Data in DB
1:07:12 One-To-One Relationship
1:28:10 Populating Fields
1:32:00 One-To-Many Relationship

Пікірлер: 53

  • @unhandledexception1948
    @unhandledexception19485 ай бұрын

    I really enjoy your videos as you are thinking out loud as you work out solutions to the various issues that come up...

  • @govindbhardwaj_
    @govindbhardwaj_Ай бұрын

    I am moving from SpringBoot with MongoDB to NestJS with MongoDB. I've tried many videos so that I could relate with my previous knowledge and it is exactly what I was looking for. I've just seen the whole video and I must say it's the one perfect video to get started.👍

  • @ansonthedev

    @ansonthedev

    Ай бұрын

    Great to hear!

  • @yuripires9025
    @yuripires90256 ай бұрын

    I was just searching for a tutorial. Since I loved your Websocket tutorial, i can expect this to be another great vid. Cheers

  • @ansonthedev

    @ansonthedev

    6 ай бұрын

    Hope you enjoy it! :)

  • @sergeyplotnikov4303
    @sergeyplotnikov43035 ай бұрын

    Very useful content! Thank you very much!

  • @esther44450
    @esther44450Ай бұрын

    Thanks a lot, I've got new skills now.

  • @mehmetaliuyar3051
    @mehmetaliuyar30514 ай бұрын

    I think u are best javascript teacher in youtube . good job bro , thanks

  • @ansonthedev

    @ansonthedev

    4 ай бұрын

    Thank you very much for saying that!

  • @nalcapital
    @nalcapital6 ай бұрын

    Thank you. Very well!

  • @user-jm8py4fu8u
    @user-jm8py4fu8u3 ай бұрын

    Thank you! greate video!

  • @overrevvv
    @overrevvv5 ай бұрын

    Thank you so much for this amazing video

  • @ansonthedev

    @ansonthedev

    5 ай бұрын

    You're welcome!

  • @sergeyplotnikov4303
    @sergeyplotnikov43035 ай бұрын

    It would be great if you made a video about clean architecture with NestJs

  • @prashlovessamosa
    @prashlovessamosa6 ай бұрын

    Thanks for making this.

  • @ansonthedev

    @ansonthedev

    6 ай бұрын

    You're welcome!

  • @MG-wx8yx
    @MG-wx8yxАй бұрын

    I really like your videos, it's just that, currently, I'm only interested only in Graphql as opposed to REST. Could you specify in the titles if it's REST or Graphql? I watched one of your Nestjs and Graphql videos and I have to say I learned so much there. Thank you so much.

  • @user-mp6fw3ii2x
    @user-mp6fw3ii2x2 ай бұрын

    nice video, nest is a bit overcomplicated sometimes, but for really big projects is very cool

  • @awaraamin6850
    @awaraamin68506 ай бұрын

    Thank you man

  • @ansonthedev

    @ansonthedev

    6 ай бұрын

    You're welcome

  • @user-fb6he4vb1u
    @user-fb6he4vb1u5 ай бұрын

    THANK YOU!

  • @ansonthedev

    @ansonthedev

    5 ай бұрын

    You're welcome.

  • @josbexerr5166
    @josbexerr516613 күн бұрын

    Excelente muy bien explicado

  • @sentinel435
    @sentinel435Ай бұрын

    thank you

  • @boss-rus
    @boss-rus5 ай бұрын

    greate video! you are super :)

  • @abdrahim9307
    @abdrahim93072 ай бұрын

    Thank you soo much

  • @charlesorafu490
    @charlesorafu49025 күн бұрын

    Thank you!!!!!!!!!!!!!!!

  • @alepaez3897
    @alepaez38972 ай бұрын

    Thanks! Very good tutorial I learned a lot. Just a question, wouldn't it be better in the one-to-many relationship to have the userId in the post. Instead of saving all posts ids in the user. Seems like updating a user is an extra query we don't need.

  • @ansonthedev

    @ansonthedev

    2 ай бұрын

    We're not saving all post IDs in the user, that is just how TypeORM requires you to save one to many and many to one relationships.

  • @RlflrRLflr
    @RlflrRLflr6 ай бұрын

    best video

  • @user-gj8sh9gx9r
    @user-gj8sh9gx9r3 ай бұрын

    Thanks

  • @rahulkumarbarnwal5978
    @rahulkumarbarnwal59782 ай бұрын

    It was a great tutorial. But if possible please provide the production ready setup it would be very helpful.

  • @riyazmusics483
    @riyazmusics4832 ай бұрын

    Nice one

  • @ansonthedev

    @ansonthedev

    2 ай бұрын

    Thanks 🔥

  • @ansonthedev

    @ansonthedev

    2 ай бұрын

    Thanks 🔥

  • @darlleybrito4198
    @darlleybrito419820 күн бұрын

    Para o user você adicionou uma validação (para encontrar um userId se ele existir) no controller, no Post você adicionou validação parecida mas dentro da Service, qual o local ideal para este tipo de validação?

  • @pateltanaka49
    @pateltanaka496 ай бұрын

    great video , , iave a question , lets say on the posts i only want only want to populate the title only when doing a get request how do i do that

  • @ansonthedev

    @ansonthedev

    6 ай бұрын

    Good question, see this: mongoosejs.com/docs/populate.html#setting-populated-fields

  • @selimolmaz2896
    @selimolmaz28963 ай бұрын

    thanks man🤌

  • @omarh.soliman6814
    @omarh.soliman68146 ай бұрын

    how are u writing with cursor that smooth can you tell whats the extention and also the terminal type

  • @ansonthedev

    @ansonthedev

    6 ай бұрын

    It’s a setting in vs code called “smooth cursor”

  • @awaraamin6850
    @awaraamin68504 ай бұрын

    please do a full stack project using angular 17 and nestJs with mangoDB if it is doable! Thank you

  • @apple1697
    @apple16974 ай бұрын

    Hi, I have a question. Where we defined the id field?

  • @ansonthedev

    @ansonthedev

    3 ай бұрын

    Depending on what your need is, the "id" field is autogenerated by the database. MongoDB will do that for each document by default. If you need additional unique ids you can define them in the schema/model file. Be sure to set the unique constraint too.

  • @PedroHMelo
    @PedroHMelo6 ай бұрын

    Agr sim ❤️

  • @user-br8kr3qj6y
    @user-br8kr3qj6yАй бұрын

    Дякую

  • @gorfadumesh326
    @gorfadumesh3262 ай бұрын

    nest g resource users --no-spec User this command and create all the files like module, Dto, controller and service

  • @ns-gabrielmendoza1329

    @ns-gabrielmendoza1329

    Ай бұрын

    Do you have any more useful commands?

  • @polymath-403
    @polymath-4036 ай бұрын

    Sir What's Your VSCODE font name ?

  • @ansonthedev

    @ansonthedev

    6 ай бұрын

    Operator Mono

  • @sahakhovhannisyan1418
    @sahakhovhannisyan14183 ай бұрын

    👍

  • @darlleybrito4198
    @darlleybrito419820 күн бұрын

    O meu User não trazia o Settings com o ".populate()" por nada... o erro estava no schema, "ref" estava "Ref" 😅 ``` @Prop({ type: mongoose.Schema.Types.ObjectId, Ref: 'UserSettings' }) settings?: UserSettings ```

  • @phantazzor
    @phantazzor21 сағат бұрын

    what's the difference between @IsNotEmpty and @Prop({required:true}) and why we cannot see the user from the post

Келесі