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

Aggregation examples don't work due to missing cursor option

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6, 4.0.0
    • Component/s: None
    • Labels:
      None

      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.)

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

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