We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e882a2 commit a2e3b47Copy full SHA for a2e3b47
tests/cursor/cursor-destruct-001.phpt
@@ -10,7 +10,16 @@ function getNumOpenCursors(MongoDB\Driver\Manager $manager)
10
{
11
$cursor = $manager->executeCommand(DATABASE_NAME, new MongoDB\Driver\Command(array('serverStatus' => 1)));
12
$result = current($cursor->toArray());
13
- return $result->cursors->totalOpen;
+
14
+ if (isset($result->metrics->cursor->open->total)) {
15
+ return $result->metrics->cursor->open->total;
16
+ }
17
18
+ if (isset($result->cursors->totalOpen)) {
19
+ return $result->cursors->totalOpen;
20
21
22
+ throw new RuntimeException('Could not find number of open cursors in serverStatus');
23
}
24
25
$manager = new MongoDB\Driver\Manager(STANDALONE);
0 commit comments