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

Aggregation's group is not behaving correctly with a single group.

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.1
    • Component/s: None
    • Labels:

      The following aggregation
      {
      $match : {
      filename :

      { $in : defaultFilesArray }

      }
      }, {
      $project :

      { filename : 1, _id : 0 }

      }, {
      $group : {
      _id : 1,
      pages :

      { $push : '$filename' }

      }
      }

      Should output an array with a single element, containing the array 'pages' and this array would contain the strings for the filenames.
      However, when toArray is used on the resulting cursor, I get the following:

      [

      { "filename": "/404.html" }

      ,

      { "filename": "/audioGenericThumb.png" }

      ,

      { "filename": "/defaultBanner.png" }

      ,

      { "filename": "/genericThumb.png" }

      ,

      { "filename": "/login.html" }

      ,

      { "filename": "/maintenance.html" }

      ,

      { "filename": "/maintenanceImage.png" }

      ,

      { "filename": "/spoiler.png" }

      ]

      It seems the group stage is not being processed at all.

            Assignee:
            Unassigned Unassigned
            Reporter:
            stephenlynx Stephen Lynx
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: