Complete MongoDB aggregation pipeline course

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ม.ค. 2025

ความคิดเห็น • 116

  • @HiteshCodeLab
    @HiteshCodeLab  ปีที่แล้ว +37

    Just a quick note, you can use any data for this video. I don't own this data. Half of it was taken from online and half of it was generated by ChatGPT. Data is not important here, these questions and use cases are important and these were were totally designed by me.
    Thanks and please share 😁
    gist.github.com/hiteshchoudhary/a80d86b50a5d9c591198a23d79e1e467

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

    "08:30" - Create collection in Mongodb cluster and inserting data via Mongodb extension from vs code
    "15:14" - How to use aggregation pipeline inside Mongodb
    * Use $ sign with operator and field name*
    "18:38" - count operator with match "31:19" - sum with grouping avoid count "48:46"- Avoid using count with group bad
    "22:15" - grouping by _id with "$filed" "24:06"- grouping all by null
    "24:42" - grouping and getting avg via $avg
    "33:02" - filtering on 2nd stage via sort
    " 35:36" - summarizing questions
    "51:52" - Nested drilling and sorting and limiting***

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

      question is, how do we put it in code if you are using node.js for example?

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

    I'm quite impressed with this video. I tried learning the MongoDB aggregation pipeline two years ago. I could not grasp it. With this video, I am confident to apply it to my Node.js backend projects with ease. It has also helped to learn how to use the MongoDB docs. With this, I will watch your other videos due to your easy way of teaching. More grease to your elbow.

  • @tarunbidaliya9438
    @tarunbidaliya9438 ปีที่แล้ว +45

    Some additional tips
    1) Always think TWICE when you are using operators like "$unwind' because it is very costly operator because it creates multiple copies of a same documents. Try to think some other possible solution. Some costly operators are: "$lookup", "$unwind", "$facet", etc.
    2) It is a best practice to use $project after the $group stage in the pipeline because "by default, mongodb return a BSON object and not a JSON object" and BSON object have more properties than a JSON object. So using the $project, you can get the JSON object You can study this point for more knowledge.
    3) If the size of your document is big, then always use ".allowDiscUse(true)" in your aggregation pipeline.
    4) When dealing with larger chunks of data, use "cursor" and "batchSize" approach.

    • @CookerSingh
      @CookerSingh ปีที่แล้ว

      Although not always used, the .allowDiskUse(true) option causes MongoDB to create temporary files on disk and use these files to perform aggregation operations. Since disk I/O is much slower than memory I/O, In some cases, allowing disk usage may strain performance.

    • @DineshPawartech
      @DineshPawartech ปีที่แล้ว

      Ya using unwind can cuases problem too so for that need to know about arrayElment like operators ,the point you are saying totally aggree with that

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

      tx for this information i never know that and I use this operators in many queries from now on I will mind this things before using

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

      how did u got so much in depth knowledge?

  • @tanishkagupta6864
    @tanishkagupta6864 8 หลายเดือนก่อน +36

    I don't understand what kind of content people want in the world of paid classes? These videos are totally free. is this the reason of not getting credit? Let's appreciate his explanation and please show some support i don't want him to stop making videos.

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

    Its really very very underrated, it should have its views in millions. If anyone wants to learn anything useful for MongoDB this is the only video. beautifully explained

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

    Gratitude to Hitesh Choudhary for the insightful MongoDB aggregation pipeline tutorial! His expertise and clear explanations have been instrumental in enhancing my understanding of this powerful feature. Thank you, Hitesh, for your valuable contribution to the developer community!"

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

    Best series on the mongodb aggression pipeline on the internet. Thank you so much Hitesh sir ❤

  • @Nitesh_Saini_
    @Nitesh_Saini_ ปีที่แล้ว +3

    Guruji aapki is series ki first video se hi dekh rha hu

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

    Thank you very much for teaching it this way by solving scenario/requirement based questions, rather than just talking about all the operators present in mongodb.

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

    One of the best videos on aggregation. Thanks a lot sir Ji....❤

  • @sidhantdhyani9567
    @sidhantdhyani9567 ปีที่แล้ว +1

    At 49:18 , Just wanted to tell, We can count No. of males and females using this also
    [
    {
    $group: {
    _id: '$gender',
    count: {
    $count: {}
    }
    }
    }
    ]
    But $count is generally used for counting no of documents in a stage.

    • @AliHaider-tr9rm
      @AliHaider-tr9rm 5 หลายเดือนก่อน

      In grouping use $sum instead of $count

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

      @@AliHaider-tr9rm Yup

  • @thanhquachable
    @thanhquachable ปีที่แล้ว +2

    Hi Hitesh, thank you for such an informative video about MongoDB Aggregration.
    I am new to MongoDB and this is very helpful.
    For those who want to take it step further to display only the author_name instead of the whole object 🤓 :
    [
    {
    $lookup: {
    from: "authors",
    localField: "author_id",
    foreignField: "_id",
    as: "author_details"
    }
    },
    {
    $addFields: {
    author_details: {$arrayElemAt: ["$author_details", 0]}
    }
    },
    {
    $addFields: {
    author_name: "$author_details.name"
    }
    },
    {
    $project: {
    author_name: 1, id: 1, genre: 1, author_id: 1, title: 1
    }
    }
    ]

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

    This is understated series...u made aggression so easy ❤❤

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

    I am here after completing the Aggregation and pipelines video on Chai or Code . Really Sir Nobody can't teach as you teach, I paid 80k for full-stack dev and now I am a Full-Stack dev but really sir I have learned all things like JavaScript, ReactJs and BackEnd from you . Really Sir you are my hero and I am your fan 🥺

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

    You help me a lot in learning MongoDB operations besides those for CRUD. I am more confident in using aggregation pipeline to collect statistic information now. Thanks you for your work! Expecting your new video on Tailwindcss...

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

    This is best video to learn MongoDB pipeline. Thankyou sir.........

  • @pasej5
    @pasej5 ปีที่แล้ว

    This is gold. This is the best tutorial on MongoDB out there. It is nice and easy to follow thank you, bro🙏🙏

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

    Really good course! Love your energy, very easy to follow along with the different missions

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

      Glad you enjoy it!

  • @mainakmukhrjee6328
    @mainakmukhrjee6328 ปีที่แล้ว +2

    Nice video sir! Will surely implement this in my side project!

  • @AmpulsePerspectives-og4ei
    @AmpulsePerspectives-og4ei ปีที่แล้ว +3

    Guruji aap aap mahaan hoo❤❤

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

    First, thank you for your excellent explanation, I loved the course, enjoyed it a lot, and learned from it. but I would like to add a point, you said at the beginning of the course that this tutorial is for beginners which is not necessary because, this is my first time studying MongoDB aggregation and MongoDB in general, but I do have a background in Software Enginnering. However, I find the course perfect for first learning and global all the basics needed to start working with MongoDB Aggregations, but not enough for more advanced and complex queries. so I recommend you to add a course for advanced and complex queries. we will appreciate it a lot. Thank you!!!

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

    Thank you so so much Man! Such incredible work! WE ARE HAPPY WE HAVE PEOPLE LIKE YOU ON THIS PLANET!

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

    Thanks for your unique way of tutorials, with practical implementation and assignments. Learnt MongoDB and feeling confident in same. Also this helped me in Javascript Backend assignment.
    Really liked your way of teaching 😇

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

    You taught me about pipeline aggregation in mongo db with detailed explanation....🎉 Thanks 🎉

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

    Great video on aggregation. Thank you Hitesh! I think we can have more scenarios like operations on array of objects (and when some fields don't exist in some documents). These are more challenging in real life.

  • @shivamprasad-jm3bg
    @shivamprasad-jm3bg ปีที่แล้ว

    omg, I can't believe this is the best video on MongoDB aggregation pipeline

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

    Great tutorial I have ever seen. Thank you a lot for this precious tutorial.

  • @DanielAdekunle-wn6pv
    @DanielAdekunle-wn6pv 6 หลายเดือนก่อน

    thank you very much for sharing, this is very very very very insightful, you 've just saved me a lot of time of wondering up and down to understand aggregation pipeline

  • @ImthiazRagib-mn2oc
    @ImthiazRagib-mn2oc 8 หลายเดือนก่อน

    You are a career maker. love from UAE

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

    This video is awesome 😁😁
    Thanks Hitesh

  • @anonyone8834
    @anonyone8834 ปีที่แล้ว +11

    I think you taught aggregtion better in english compared to tut on chai aur code

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

    you have nailed it, Bro! ❤‍🔥

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

    Amazing way of teaching. Thank you so much!

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

    Thanks much Hitesh

  • @josemfcheo
    @josemfcheo ปีที่แล้ว

    I just needed this! thanks so much!

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

    Thank you sir. This vid took my mongo knowledge at next level ❤❤

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

    Really helpful video! I learned alot

  • @Unknownnng
    @Unknownnng 28 วันที่ผ่านมา

    Great session

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

    Thank you from Senegal

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

    Thank you very much. It helps me a lot

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

    this can be another way the question
    Q. number of users which have "ad" as a tag at index 2
    [
    {
    $unwind: {
    path: "$tags",
    includeArrayIndex: "arrayindex",
    },
    },
    {
    $match: {
    $and: [
    {
    arrayindex: 1,
    },
    {
    tags: "ad",
    },
    ],
    },
    },
    {
    $count: 'users'
    }
    ]

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

    Can u make video on indexing too

  • @davidmukoro1166
    @davidmukoro1166 ปีที่แล้ว +2

    Thanks so much for this tutorial.Could you take it a little further by actually writing a backend NodeJs to utilize those query results of the aggregation.I mean how to use it in the backend

    • @sidhantdhyani9567
      @sidhantdhyani9567 ปีที่แล้ว +2

      in node you can use it like you might have used products.find() method or products.findByID() method, in the same way you can use product.Aggregate() and inside parenthesis write your aggregation query. If that helps ✌.

    • @davidmukoro1166
      @davidmukoro1166 ปีที่แล้ว

      @@sidhantdhyani9567 : Perfect!!!! That solves my query and it has helped me so much. Now i am beginning to like mongodb.

  • @Amir-tt8qw
    @Amir-tt8qw 10 หลายเดือนก่อน

    Thanks for the tutorial ❤.

  • @dasmala9175
    @dasmala9175 ปีที่แล้ว

    Excited 🎉

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

    great explanation sir

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

    Thanks a lot sir for this tutorial❤❤

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

    thank you sir ♥ ♥
    The video helped me a lot to complete your JS backend assignment.
    Your ChaiAurBackend series is awesome, too

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

    Wow! wonderful course. Can i like more than once?

  • @Md.BulbulAhammed
    @Md.BulbulAhammed 10 หลายเดือนก่อน

    Thank you sir, for important tutorial

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

    Can you do video on how to use indexes on aggregation pipeline

  • @Truth-seeker333
    @Truth-seeker333 5 หลายเดือนก่อน

    awesome content

  • @mozammilpagal6876
    @mozammilpagal6876 ปีที่แล้ว +1

    hii sir love from chai aur code😃😆

  • @friderichwisniewski8154
    @friderichwisniewski8154 ปีที่แล้ว

    we want more videos on MongoDB Aggregation Pipeline

  • @dillanclark864
    @dillanclark864 2 วันที่ผ่านมา

    Came for the MongoDB, stayed for the viiibe :)

  • @sumantabhattacharya9694
    @sumantabhattacharya9694 5 หลายเดือนก่อน +2

    [
    {
    $unwind: {
    path: "$tags",
    }
    },
    {
    $group: {
    _id: "$_id",
    count: {
    $sum: 1
    }
    }
    },{
    $group: {
    _id: null,
    avg: {
    $avg: "$count"
    }
    }
    }
    ]
    $unwind: This operator breaks up the array field ($tags) into individual documents. If a document has 3 elements in the tags array, it will create 3 separate documents, each containing one element from the array.
    $group: The first $group groups these documents back together by their original _id. It counts how many documents were created for each _id, which corresponds to the number of elements in the tags array for each user.
    $group: The second $group aggregates these counts into a single document and calculates the average ($avg) number of tags per user.

  • @shivarajbandaru2216
    @shivarajbandaru2216 ปีที่แล้ว

    east or best bhai is best

  • @nigam_sharma
    @nigam_sharma ปีที่แล้ว

    Its amazing ❤

  • @DevLife_in
    @DevLife_in ปีที่แล้ว

    Helpful, Thanks
    🤟🤘

  • @Zara-pn9im
    @Zara-pn9im 7 หลายเดือนก่อน

    thank you so. much sir

  • @vinod-ci5gy
    @vinod-ci5gy ปีที่แล้ว

    Thank you sir ❤

  • @rishiraj2548
    @rishiraj2548 ปีที่แล้ว

    Great! Thanks.

  • @sandipshrestha5342
    @sandipshrestha5342 ปีที่แล้ว

    Thanks ❤❤

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

    great course

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

    great tutorial tysm

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

    best video

  • @naveenp.n6578
    @naveenp.n6578 26 วันที่ผ่านมา

    What are the steps to create mongodb atlas

  • @Shiv_Kumar_Singh__
    @Shiv_Kumar_Singh__ ปีที่แล้ว

    thank you sir :)

  • @abhinay.k
    @abhinay.k 4 หลายเดือนก่อน

    thanks

  • @CrittiZops
    @CrittiZops ปีที่แล้ว

    Sir can you make a video on Docker & K8s? That would be really helpful :)

  • @Skilla_code
    @Skilla_code ปีที่แล้ว

    Ok sir

  • @shehza-d
    @shehza-d ปีที่แล้ว

    Where can i get the list of questions??

  • @ShubhanshuSneh-f5x
    @ShubhanshuSneh-f5x 10 หลายเดือนก่อน

    nice video

  • @AshutoshSingh-fy2xc
    @AshutoshSingh-fy2xc ปีที่แล้ว

    Sir, I am not able to access lco app and website.Its saying contact Admin.Please help

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

    wow😮😮

  • @i_vishalsah01
    @i_vishalsah01 ปีที่แล้ว +1

    Sir, could ypu help us with a mongo db aggregation project as it is almost impossible to find a good one it will help us get to know more how this is used in production live projects

    • @HiteshCodeLab
      @HiteshCodeLab  ปีที่แล้ว +1

      It’s going on at my Hindi channel

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

    If anyone is not able to use the regex expression as shown in the video use this instead
    [
    {
    $match: {
    phone:{
    $regex: "^\\+1"
    }
    }
    },
    {
    $count:"Number starting from +1"
    }
    ]

  • @rohanchoudhary4034
    @rohanchoudhary4034 ปีที่แล้ว

    I miss LCO

  • @VishalKumar-je1gq
    @VishalKumar-je1gq ปีที่แล้ว

    I am not able to find any good D3 js tutorial video ?? Any suggestions.

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

    ❤❤

  • @JeetuKumar-wd1uw
    @JeetuKumar-wd1uw ปีที่แล้ว +1

    Sir es video ko hindi mai layea please so that I can learn properly

  • @sujaysaha7429
    @sujaysaha7429 ปีที่แล้ว

    Sir 1 on 1 kese baat kr skte hai aap se ?

  • @noman-i6r
    @noman-i6r 4 หลายเดือนก่อน

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

    Bro can make me software enginner in month!

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

    Sir app aggregation ki Hindi me video bda doo

  • @rayansingh5246
    @rayansingh5246 ปีที่แล้ว

    Hello ❤sir ji

  • @FreeTrial0315
    @FreeTrial0315 ปีที่แล้ว +3

    Sorry sir I cannot purchase your paid course bacause you say that real developer is that who do self not watch only tutorial

  • @ravipratap2349
    @ravipratap2349 ปีที่แล้ว

    ❤❤❤❤❤❤❤❤❤❤❤

  • @JustUs80
    @JustUs80 ปีที่แล้ว

    👍

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

    It looks like array.map().filter().reduce().

  • @Darkgamer_019
    @Darkgamer_019 ปีที่แล้ว +1

    Sir mongo DB को हिंदी मैं लाहो sir plz......

  • @onlineworld11111
    @onlineworld11111 ปีที่แล้ว

    Hey

  • @arindamdutta7369
    @arindamdutta7369 ปีที่แล้ว +3

    Not able to understand, what is being happening here . Kabhi kabhi bolte hai aap free course sa kuch a to z mil jayega. kabhi backend ka 6999 rs lete hai

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

    ok

  • @shubhamkakad10x
    @shubhamkakad10x ปีที่แล้ว

    #chaiaurcode

  • @Mahmudulhasan-ts5hm
    @Mahmudulhasan-ts5hm หลายเดือนก่อน

    you talk too much,

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

    Exteremely grateful for such content! 🫡❤

  • @rakeshchoudhary894
    @rakeshchoudhary894 ปีที่แล้ว +1

    Hi sir

  • @rakeshchoudhary894
    @rakeshchoudhary894 ปีที่แล้ว

    Hlo sir ji