Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1642

nested grouping of array in mongodb

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 3.0.4
    • Component/s: MongoDB 3.4

      Dear,

      I am facing issue while making internal a group for itemList. the sample data is attached here please find it.

      My expected result will be like this.

      {"result":[{"userName":"Robert Son","mobileNo":9845500111,"active":true,"itemCount":51,"itemList":[
      "Iron":

      {count:51,price:55}

      ,Wash_Iron:

      {count:0,price:0}

      ]}]}

      basically I want group the item type in each records and add back to same record. how to do this one. I am struct here. please help me.
      I want to get individual count on Iron, Wash_Iron with item conut and price value to show in admin panel, so that we can easy understand how many came to iron and how many came to wash_irom.

      Regards
      Mallikarjuna

        1. Sample_mongodb.txt
          3 kB
          Mallikarjuna N

            Assignee:
            Unassigned Unassigned
            Reporter:
            mallikarjuna023@gmail.com Mallikarjuna N
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: