Sequelize Tutorial: Episode 11 - Associations (hasOne, belongsTo, hasMany, belongsToMany)

Поделиться
HTML-код
  • Опубликовано: 9 сен 2024

Комментарии • 97

  • @alovesxo9581
    @alovesxo9581 3 года назад +20

    Wittcode you are amazing! I’ve been struggling with associations forever!!! 💓

    • @WittCode
      @WittCode  3 года назад +1

      Thanks so much for your continued support! 😄

    • @testuser2427
      @testuser2427 Год назад

      Amazing you are an amazing source for a startup project

  • @jameshalstead6742
    @jameshalstead6742 2 года назад +14

    I've searched for days, maybe weeks. Found a few very beginner videos, even my favorite Udemy courses don't cover sequelize to the extent you did in this series. You have an easy voice to listen to, you don't move too fast, you do an amazing job explaining literally everything, I feel excited to finally be able to work on the sequelize part of my project that I have been putting off. I hope you continue this series but I would highly encourage you to think about selling a course like this on Udemy, I would seriously pay $10 for it maybe even $20 (I only pay for Udemy if it's on sale lol) if it had even further advanced concepts. Either way, if your goal is to find more followers, I say don't give up, you will get there. Your content so far in this series is A+. Thank you for your time

    • @_Greenflag_
      @_Greenflag_ 4 месяца назад

      Beginners need tutorial, professionnals consult the official documentation.

  • @mustafa-ahmed-dev
    @mustafa-ahmed-dev 2 года назад +5

    I was stuck at this subject for probably 2 weeks, and you saved me.
    Waiting for the part 2 :) 01:01:03

  • @SivaKumar-gn1bp
    @SivaKumar-gn1bp 11 месяцев назад +1

    Thank you so much ❤. This tutorial is very clear and easily understandable.

  • @AbubakerMahmoudshangab
    @AbubakerMahmoudshangab 11 месяцев назад

    WittCode in one word only you are : #awesome. In more than one word: You are very good #speaker, #explainer and #facilitator. Thank you very veru very much. You have amazing future, be prepared.

  • @arun-ph9cn
    @arun-ph9cn Год назад

    I was struggling in understanding the relational tables in sequelize SQL. This 1 hour video has been a life saver for me. Thank you very much for uploading

  • @tamuahmed5303
    @tamuahmed5303 3 года назад +2

    Waiting for the next video. Thanks for this series.

    • @WittCode
      @WittCode  3 года назад +1

      Good to hear from you again Tamu! I am currently working on the rest of this series and a few other videos as well so it'll be up soon! 😃

  • @akr_ijk
    @akr_ijk 2 года назад

    just finished ...I cleared many things about sequeliz.Thank you very much......

  • @pedrobonorino9063
    @pedrobonorino9063 2 года назад +1

    I've been trying to create and use associations correctly for 2 weeks, finally a video that TRULY helped me. Thanks man, take my sub and heart

  • @theryanmark
    @theryanmark 2 года назад

    Thank you so much! I've been searching for clarity on this topic for days. Your saving my life! 🤣

  • @nubiemir7234
    @nubiemir7234 2 года назад

    love each and every part of this series.... thanxs Wittcode,

  • @SanMati14
    @SanMati14 Год назад

    Amazing video, so clear to teach everything. Thank you!

  • @asamitam1605
    @asamitam1605 2 года назад

    Just finished watching the entire series. Thank you so much for your time and great teaching. ❤❤

  • @olaleyeolabanjo
    @olaleyeolabanjo Год назад

    Thank you so much. I have watched all the videos.
    Next videos please🙏🙏🙏

  • @ham97oda
    @ham97oda Год назад

    A tons of thanks, you made it really easy to understand💐

  • @ztamnaja
    @ztamnaja 2 года назад

    Thank you a lot wittcode! i'm waiting for next series.😁

  • @cesarmuzio1154
    @cesarmuzio1154 2 года назад

    Thank you so much for this ! I have to deliver a test, and I had no clue about sequelize..this series helped me a lot !

  • @princekumarrana4248
    @princekumarrana4248 7 месяцев назад

    Nicely explained. Thankyou

  • @mimiocean8
    @mimiocean8 2 года назад

    you made it all so simple thank you so much 😭😭

  • @dhairyachauhan6622
    @dhairyachauhan6622 7 месяцев назад

    Hello sir loved your course on sequlize, just wanted to add please cover more methods such as how to update values in the through column and many more if you get time,
    once again loved your content.

  • @peytoncastillo4508
    @peytoncastillo4508 Год назад

    Great video!

  • @iamlookto
    @iamlookto 2 года назад

    This helped me so much learning sequelize. Thank you so much!

  • @Hawtep
    @Hawtep 2 года назад +1

    I was having a bad time with associations in Sequelize and this helped me a lot, thank you

  • @bojjabheemaraju387
    @bojjabheemaraju387 2 года назад

    Thanks a lot! This tutorial is great. I learned more from this tutorial.

  • @user-ir2vf2nw6d
    @user-ir2vf2nw6d 2 года назад

    oh yeah~! I'm almost done!!

  • @davinder95
    @davinder95 Год назад

    thankyou for this wonderful course

  • @NikhilPatil647
    @NikhilPatil647 10 месяцев назад

    great video, keep the good bro :D

  • @Sergio-ef5pz
    @Sergio-ef5pz Год назад

    This looks terrific! Was interested on the topic of this video, but I'll checkout the entire playlist, thanks!!

  • @nathanteissier1191
    @nathanteissier1191 Год назад

    incredible serie of video ! keep going !!

  • @ninigogatishvili650
    @ninigogatishvili650 Год назад

    I have just finished the series and this was very amazing

  • @codeblood87
    @codeblood87 2 года назад

    Thank you so much for your hard works.

  • @elotfreelancing1791
    @elotfreelancing1791 Год назад

    brother your vids are nice.

  • @TVfunhouseGAMES
    @TVfunhouseGAMES 2 года назад

    This was fantastic. Very detailed and thorough, clear audio/speech, and great content. This helped me out a lot!

  • @millen_basquiat
    @millen_basquiat Год назад

    Amazing video! Thank you so much for this, it's exactly what i was looking for.

  • @fabiandiaz1102
    @fabiandiaz1102 Год назад

    Excellent playlist!!! you are a great teacher. I'm really interested in the second part of associations, to unleash the full potential of RDBM with sequelize. Thanks again

  • @nickwoodward819
    @nickwoodward819 2 года назад

    This is a great video, you deserve more subs. Looking forward to looking at the rest of the series!

  • @mohamedyoussef8835
    @mohamedyoussef8835 Год назад

    Awesome video ++++++++ thank you 🙂

  • @AmirhosseinMehrvarz
    @AmirhosseinMehrvarz Год назад

    It was very useful

  • @AbdulGafoor-yf4zx
    @AbdulGafoor-yf4zx 2 года назад

    very good tutorial i had seen ever on sequelize. please make more videos and courses.

    • @WittCode
      @WittCode  2 года назад

      Thanks so much Abdul! I will certainly be making more sequelize videos! 😀

  • @hudyusufatsigah7626
    @hudyusufatsigah7626 2 года назад

    great content thank's

  • @saminserge2674
    @saminserge2674 4 месяца назад

    Many thanks Dear for your amazing videos

  • @estudiar173
    @estudiar173 Год назад

    good video my dude

  • @MorSag
    @MorSag Год назад

    Great tutorial (the whole 11-chapters series!). Thank you!
    Here's a request for you: please prepare a tutorial that shows how to prepare and maintain a real life dev-test-prod sequelize env. From installing the sequelize-cli, initializing the project, applying DDL along the life of the project, pushing from dev to test to prod, and other considerations such as: shall we maintain a separate project for the DB, or should it be part of the application (e.g. an Angular app using the DB)?

  • @mugiwaranoshanks2241
    @mugiwaranoshanks2241 3 года назад

    This is AMAZING !!! Thanks Wittcode!

    • @WittCode
      @WittCode  3 года назад +1

      Good to hear from you again! Thanks again haha😁

  • @adarshaniket505
    @adarshaniket505 Год назад

    Great work bro❤

  • @AlucardVaz
    @AlucardVaz Год назад

    Justin (strangers things) are you ?
    xD
    Thx for the info bro, very useful

  • @user-cr8ln4rm4u
    @user-cr8ln4rm4u 2 года назад

    Thank you very much!

  • @laveeshsharma4517
    @laveeshsharma4517 6 месяцев назад

    Really helped me a lot.Thanks

  • @MS-gi3hc
    @MS-gi3hc 6 месяцев назад

    Great tutorial!

  • @brandyn6124
    @brandyn6124 2 месяца назад

    For anybody following along, if you have been separating your Models in separate files, you will need to create a new file (which I named associations.js in my models folder), and defined the associations in that file. Afterwards, export those models in that file. Then in index.js, or wherever you run the file, you will import those Models from the association file.

    • @johanaguirreapaza5458
      @johanaguirreapaza5458 Месяц назад +1

      I had to do the same to define the relations, but I still got a problem when working with many-to-many relations. For some reason, that I do not understand, the method .addX() does not appear to me and so I cannot add new data to my intermediate table. I tried to look for a solution on different pages but I could not find a solution.

  • @muhammadyeasin722
    @muhammadyeasin722 Год назад

    Amazing series. Thank you very much.
    I want to know. When you publish second part of your video?
    Though you publish this video 1 year ago.

  • @tayyabferozi
    @tayyabferozi 3 года назад

    I am waiting for the next series you were talking about

    • @WittCode
      @WittCode  3 года назад +2

      Hey Tayyab thanks for watching! I am currently working on the rest of the series and a few other videos! So it'll be up soon! 😁

  • @hl2054
    @hl2054 Год назад

    thank you

  • @yasserhy
    @yasserhy Год назад

    I LOVE your videos. It really helped my understand how to use Sequelize. But where is the advanced video about associations you mentioned? There are really important options we are missing. Specially when the junction table has other columns that we want to retrieve and show to the user

  • @orencohen4502
    @orencohen4502 2 года назад +1

    Hi withcode, thanks for the tutorial, however I don't understand why you don't explain how to update many to many relationships at the end.
    Can you tell me how it works? the destroy works very well in cascade but the update does not work.
    You can help me please ?

  • @HaHA-tn3bf
    @HaHA-tn3bf Месяц назад

    Wonderful videos

    • @WittCode
      @WittCode  Месяц назад

      Glad you like them!

  • @kumar_sanjeevdutta1069
    @kumar_sanjeevdutta1069 8 месяцев назад

    Great

  • @jerrycelozzi
    @jerrycelozzi 2 года назад

    first of all THANK YOU...
    I have seen that when you create associations on tables that have the paranod option set to true there is a need to use hooks for the create delete and update methods to work correctly ....
    I succeeded .... but since I'm sure you are better than me ... could you make video tutorials where you explain this context?
    ....thank you!

  • @InspectorDubb
    @InspectorDubb 5 месяцев назад

    @wittcode Is there any news on the next videos for aliasing etc? would really enjoy the last pieces of this! The series has been absolutely amazing

    • @WittCode
      @WittCode  Месяц назад

      I'll never say never!

  • @tonymanuel9831
    @tonymanuel9831 Год назад

    When a new column is added, it always takes the last position in the table. How to insert it into a specific position

  • @itzDoraemon
    @itzDoraemon 2 года назад

    please use "dark theme" with future tutorials 🙏

  • @arsamhashempour8156
    @arsamhashempour8156 2 месяца назад

    THAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANK YOU A LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOT

    • @WittCode
      @WittCode  Месяц назад

      YYYYOOOOUUURREEEE WEEEEELLLCCCOOMME 😀

  • @dok3820
    @dok3820 Год назад +1

    Still desperately waiting for part 2.....

  • @ilyesteffaha572
    @ilyesteffaha572 2 года назад

    i want to add a post that has multiple tags i made a model for each and did the associations between them the middle table was created now how can i add them simultanesly when i try to add a post i don't want to assign them tags after the post is created like the one you did i'm stuck i hope you can read my message

  • @nickwoodward819
    @nickwoodward819 2 года назад

    @23:16 - allowNull: false doesn't seem to have any effect for me here

  • @nickwoodward819
    @nickwoodward819 2 года назад

    Episode 12 am cry.
    Any chance of looking at includes? Have recently come across a problem with using findAndCountAll with a many to many relationship in the include option. Have been told it's not possible and that I need to create the association manually using a one to many relationship on the join table

  • @bhojakrahul5880
    @bhojakrahul5880 2 года назад

    @WittCodE I have one issue if i have
    1) item tables (field): - id,itemName,price
    2) userTabel (fiels) ;- id, userName,itemId
    example for item table : 1 abc 100
    2 xyz 300
    3 ead 300
    example for user table :- 1 raa "1,2,3"(1,2,3 are ids of item table)
    is that pososible to do assocation and get the data?

  • @sssp1517
    @sssp1517 4 месяца назад

    Excelent series!! I have a question if you got the time. What if one customers wants to buy the same laptop on two different occasions? I have been playing with sequelize, and while this is a common use case, i am getting an error saying theres a unique constraint on the fks (meaning there can be no duplicates of fk combinations). I triend different solutions i found online but nothing seems to work. Do you know how to work around this? Thank you ❤

    • @WittCode
      @WittCode  Месяц назад

      Thanks! Sounds like that's a many to many relation. So I would create that link table where the primary key is the primary keys for customer and laptop. If you want multiple entires you could remove the unique constraint on solely the customer id and laptop id.

  • @angelleal3005
    @angelleal3005 2 года назад

    Has it ever happened to anyone that sequelize changes the name of the query params to Capital letters ? In my app I trying to implement a simple login but when I query the db to match the info already stored with what's been given by the said query the process fails because a certain column doesn't exist due to the fact that sequelize change the column name to capital in the executed query. If anyone knows or has any clue on how to fix this I would very much appreciate it.

  • @gurureddy1861
    @gurureddy1861 2 года назад +1

    OnDelete is not working if i explicitly give the foreign key value like
    A.hasOne(B, { foreignkey: name , OnDelete:'CASCADE' })
    if anyone knows the solution pls give reply

    • @ztamnaja
      @ztamnaja 2 года назад

      me too, how you fix it???

  • @gurureddy1861
    @gurureddy1861 2 года назад

    I have given extra property (id) to the junction table and given default value as UUID4, while adding entries id is set to null and throwing null constrainst error, if anyone knows the solution pls ping me

  • @ummanmemmedov
    @ummanmemmedov 4 месяца назад

    Why there is not any new video?

    • @WittCode
      @WittCode  Месяц назад

      I personally don't use ORMs very much anymore! Got a little burnt out from Sequelize too

  • @tinyreborn2954
    @tinyreborn2954 15 дней назад

    Bruh... where is the part 2 :(

  • @ActionReaction..
    @ActionReaction.. 2 года назад

    Every tutorial puts all the models into one file when showing manytomany relations. this doesn't make any sense because the same code wont work when you have multiple modelfiles like usermodel.js and productmodel.js and you wan't to create a table out of that. it will give an error saying '.belongsToMany called with something that's not a subclass of Sequelize.Model'

  • @codemind1822
    @codemind1822 Год назад

    Man thank you but I am still confused about the 30:41 case. Why can we have one to many relationship for Country.hasOne(Capital);
    Capital.belongsTo(Country);
    clearly states country has one capital. then both london and paris becomes the capital of France. Does not make sense. I think the explanation is rather vague there. Then you start explaining one to many relationships. That does not really clear up the problem here. because there, you clearly state hasOne not hasMany.

  • @avinashparakhiya
    @avinashparakhiya 2 года назад

    super content but where is source code

  • @JIlu46
    @JIlu46 3 месяца назад

    amazing video but using a white bg on your editor is evil lol

    • @WittCode
      @WittCode  Месяц назад +1

      haha yeah this when was I was relatively new to development. I always preferred light mode things back then! Definitely not anymore! 😀

  • @Osuran_Bogaa
    @Osuran_Bogaa Год назад

    please do not use white mode on videos

  • @mehmetbakii
    @mehmetbakii 8 месяцев назад

    I got error when I do many to many via junction table;
    Order many to many Product jsution table OrderProduct
    await currentOrder.addOrderProducts(foundProduct)
    TypeError: currentOrder.addOrderProducts is not a function