Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-790

aggregate() in Explainable object does not work with an object as argument

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.14.0
    • Component/s: Shell API
    • Labels:
      None
    • Documentation Changes:
      Not Needed
    • Sprint:
      Iteration Chicago

      Description

      Problem Description

      aggregate() can take either an object with a single stage or an array with multiple stages. This should be true both for the aggregate() method of a collection as well as for the aggregate() method of Explainable. However, it's not true for the latter and the error message is confusing.

      Given the error, this might be an issue in the driver.

      Steps to Reproduce

      Run db.users.explain().aggregate({$match: {email: /@gmail.com/)}}

      Expected Results

      The explain plan for that one-stage pipeline.

      Actual Results

      MongoError: Unrecognized pipeline stage name: 'explain'

      Additional Notes

        Attachments

          Activity

            People

            Assignee:
            michael.rose Michael Rose (Inactive)
            Reporter:
            massimiliano.marcon Massimiliano Marcon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: