[SERVER-38234] The 'cursor' option is required.. even if it is set Created: 23/Nov/18  Updated: 03/Dec/18  Resolved: 03/Dec/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 3.6.9
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Josef Sábl Assignee: Stennie Steneker (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-33393 The 'cursor' option is required, exce... Closed
Operating System: ALL
Participants:

 Description   

After running this aggregation, I get this error: The 'cursor' option is required, except for aggregate with the explain argument

The cursor IS THERE. When I remove the out stage it works.

db.StatEvent.aggregate([
    {
        $match: {
            'time': {$gt: timeLastRun}
        }
    },
    {$out: tempAggrName}
], {
	cursor: { batchSize: 0 }
});



 Comments   
Comment by Stennie Steneker (Inactive) [ 03/Dec/18 ]

Hi Josef,

I've only been able to reproduce this issue using versions of the mongo shell prior to 3.6 or with shell customisations like mongo-hacker that override the built-in aggregate() helper.

I don't believe this is a server issue, but if you have further details please follow up on my questions on your mongodb-user forum thread about this same topic.

Thanks,
Stennie

Comment by Josef Sábl [ 23/Nov/18 ]

Looks like running:

db.runCommand({
    aggregate: "StatEvent",
    ...

For exactly the same pipeline works. So I guess it really is a bug.

Generated at Thu Feb 08 04:48:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.