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

Comments

Projects
None yet
3 participants
@liangmingran
Copy link

liangmingran commented Dec 23, 2017

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

This comment has been minimized.

Copy link
Member

markstory commented Dec 24, 2017

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

markstory commented Jan 24, 2018

Thanks @skors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment