[DOCS-12036] Aggregation examples don't work due to missing cursor option Created: 06/Sep/18 Updated: 12/Sep/18 Resolved: 10/Sep/18 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | 3.6, 4.0.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ori Avtalion | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Participants: | |||||||||||||
| Days since reply: | 5 years, 22 weeks ago | ||||||||||||
| Description |
DescriptionMongoDB 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:
fails with the error:
Scope of changesImpact to Other DocsMVP (Work and Date)Resources (Scope or Design Docs, Invision, etc.) |
| Comments |
| Comment by Kay Kim (Inactive) [ 12/Sep/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
:thumbsup: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ori Avtalion [ 12/Sep/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry, this is my mistake. I had mongo-hacker installed, which had its own version of the aggregate function. I will report a bug there. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kay Kim (Inactive) [ 10/Sep/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Closing as cannot reproduce using the newly downloaded mongo shell for 3.6 and 4.0.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kay Kim (Inactive) [ 06/Sep/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi salty-horse – thanks for filing this ticket. Using the shell helper:
However, if you are using the command directly, then, you would get that error:
Because the helper method already returns a cursor, you might find that more intuitive to use and most of our examples use the shell helper. If you are using the helper method, could you verify your mongo shell version as well as your server version? These should print when you first open a mongo shell:
|