Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-4239

Agg builder doesn't work with set & unset stages

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.21.0
    • Affects Version/s: 1.20.5, 1.21.0
    • Component/s: Aggregation pipeline
    • None
    • Environment:
      Ubuntu 18.04
    • Iteration Blackberry

      issues trying to use $set & $unset in Compass Aggregation builder (Compass v1.20.5 & 1.21.0-beta.4 - Ubuntu 18.04)?

      Mongo Shell happily executes my pipeline but Compass doesn't like it and reports format errors.

      // agg pipeline that works in shell but when imported into Compass causes problems:
          [{$unwind: {
            path: '$members'
          }}, {$unwind: {
            path: '$members.name'
          }}, {$group: {
            _id: '$members.name',
            number: {$sum: 1}
          }}, {$sort: {
            number: -1
          }}, {$limit: 10
          }, {$set: {
            name: '$_id.val'
          }}, {$unset: ['_id']
          }]
      

      See attached screenshot showing Compass errors.

      Note, when imported into Compass, no errors are initially shown but the pipeline doesn't produce results. Go into the $set or $unset stage, remove an apostrophe character (or whatever) and then re-add the same identical character and the Compass errors will then be shown.

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            paul.done@mongodb.com Paul Done
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: