🔥Mongodb Aggregation Tutorial | Aggregation Functions in Mongodb | Mongodb Tutorial | Simplicode

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

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

  • @sakarienuh6293
    @sakarienuh6293 Год назад +17

    TIP:
    whenever you open a bracket/parenthesis always immediately close it without writing anything in first. Open the bracket > then close it> then go back to the closed bracket/parenthesis and write in it. in that way you wont confuse with how many brackets you need to close after u write everything and in the video thats why there was an error in the first example because there was one parenthesis missing.

  • @faroozrimaaz7092
    @faroozrimaaz7092 Год назад +8

    Underrated channel...he deserves million..very good explanation man..

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

      We are glad that you have enjoyed your learning experience with us : )

  • @VidyashreeMayee
    @VidyashreeMayee 6 месяцев назад +1

    Nice explanation... it's very useful to everyone ☺️

  • @antonixff3663
    @antonixff3663 9 месяцев назад +1

    my man. thanks

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

    thanks you very much dude

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

    Good detail, thanks men..!

  • @suryatejess-u7l
    @suryatejess-u7l Месяц назад

    7:08

  • @raghu4199
    @raghu4199 Год назад +2

    where can we get the data that you are using?

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

    Super Class

  • @suryatejess-u7l
    @suryatejess-u7l Месяц назад

    7:51 7:08

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

    Above code for list of department id @13:02 the output i m getting is { _id:department_id } not the whole list of ids..what m i doing wrong?

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

    Brother,iam getting repeated 2 times output for match command

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

    Hi, how do you find the entry of department ID that occurs more than once

    • @SimplicodeOfficial
      @SimplicodeOfficial  Год назад +2

      To find the entry of a department ID that occurs more than once in MongoDB, you can use the aggregation framework and the $group operator. Here's an example query:
      db.collection_name.aggregate([
      {
      $group: {
      _id: "$department_id",
      count: { $sum: 1 }
      }
      },
      {
      $match: {
      count: { $gt: 1 }
      }
      }
      In this query, we first group the documents in the collection by the department_id field using the $group operator. We create a new field called count using the $sum operator to count the number of documents in each group.
      Then, we use the $match operator to filter out the groups where the count is less than or equal to 1. The resulting documents will have the _id field equal to the department_id and the count field equal to the number of times that department_id appears in the collection.

  • @krish3d385
    @krish3d385 11 месяцев назад +2

    This is an explanation given like a amateur. I appreciate the efforts though. You did lots of syntax issue and you did not cover how you fixed it. Well professional like me can take advantage over internet but think about beginners. And you missed lots of other serious points.

    • @youssef944
      @youssef944 9 месяцев назад

      what're u doing here?

    • @krish3d385
      @krish3d385 9 месяцев назад

      @@youssef944 wasted time, still wasting time. RUclips algorithm made me do it. Dont call me out. Do something meaningfull.

    • @youssef944
      @youssef944 9 месяцев назад

      @@krish3d385 What