Skip to content

Commit 11e67d1

Browse files
committed
PHPLIB-1115: Fix waitForSnapshot() for MongoDB 7.0+
Using find instead of aggregate should ensure documents are available in the calling test case on 7.0+ servers.
1 parent 789368a commit 11e67d1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/DocumentationExamplesTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,10 +1981,7 @@ private function waitForSnapshot(string $databaseName, string $collectionName):
19811981

19821982
do {
19831983
try {
1984-
$collection->aggregate(
1985-
[['$match' => ['_id' => ['$exists' => true]]]],
1986-
['session' => $session]
1987-
);
1984+
$collection->findOne([], ['session' => $session]);
19881985

19891986
break;
19901987
} catch (CommandException $e) {

0 commit comments

Comments
 (0)