Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12036

Aggregation examples don't work due to missing cursor option

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 3.6, 4.0.0
    • None
    • None

    Description

      Description

      MongoDB 3.6 had a breaking compatibility change: "If you run the aggregate command, you must include either the cursor option or the explain option."

      Many examples don't appear to have been updated, leaving users to puzzle out what's wrong.

      For example, in the documentation for the $unwind operator, the command:

      db.inventory.aggregate( [ { $unwind : "$sizes" } ] )

      fails with the error:

      aggregate failed: {
      {{ "ok": 0,}}
      {{ "errmsg": "The 'cursor' option is required, except for aggregate}}
      with the explain argument",
      {{ "code": 9,}}
      {{ "codeName": "FailedToParse"}}
      }

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Activity

          People

            Unassigned Unassigned
            salty-horse Ori Avtalion
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              5 years, 22 weeks ago