Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[error] he 'cursor' option is required, except for aggregation explain #221

Closed
liangmingran opened this issue Dec 23, 2017 · 3 comments · Fixed by #228
Closed

[error] he 'cursor' option is required, except for aggregation explain #221

liangmingran opened this issue Dec 23, 2017 · 3 comments · Fixed by #228
Labels

Comments

@liangmingran
Copy link

if you mongo version >3.5 , you will see the error in Recent runs pages by clicking an url link

the 'cursor' option is required, except for aggregation explain

fix it by modify /path/xhgui/src/Xhgui/Profiles.php

$this->_collection->aggregate(array(
            array('$match' => $match),
            array(
                '$project' => array(
                    'date' => $col,
                    'profile.main()' => 1
                )
            ),
            array(
                '$group' => array(
                    '_id' => '$date',
                    'row_count' => array('$sum' => 1),
                    'wall_times' => array('$push' => '$profile.main().wt'),
                    'cpu_times' => array('$push' => '$profile.main().cpu'),
                    'mu_times' => array('$push' => '$profile.main().mu'),
                    'pmu_times' => array('$push' => '$profile.main().pmu'),
                )
            ),
            array(
                '$project' => array(
                    'date' => '$date',
                    'row_count' => '$row_count',
                    'raw_index' => array(
                        '$multiply' => array(
                            '$row_count',
                            $percentile / 100
                        )
                    ),
                    'wall_times' => '$wall_times',
                    'cpu_times' => '$cpu_times',
                    'mu_times' => '$mu_times',
                    'pmu_times' => '$pmu_times',
                )
            ),
            array('$sort' => array('_id' => 1)),
        ),array('cursor' => array('batchSize' => 0)));
@markstory
Copy link
Member

Any chance you could send a pull request for this fix? I don't use mongo > 3.5.

@markstory markstory added the bug label Dec 24, 2017
skors added a commit to skors/xhgui that referenced this issue Jan 23, 2018
@skors
Copy link
Contributor

skors commented Jan 23, 2018

Hi,

I've added a pull request #228 for this to patch, based on @liangmingran informations

@markstory
Copy link
Member

Thanks @skors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants