Update src/Client.php

Co-authored-by: Jake Barnby <jakeb994@gmail.com>
This commit is contained in:
Shimon NewmanandJake Barnby authored and GitHub committed 2025-10-20 13:59:40 +03:00
1 parent 62d03aebb6
commit ce62464142
1 file changed
+4 -2
+4 -2
View File
@@ -330,8 +330,10 @@ class Client
// MongoDB will reject commands with readConcern that have txnNumber but not startTransaction
// Or if the command is in the readConcernNotSupporteedCommands array
if (((isset($command['txnNumber']) && !isset($command['startTransaction']) && isset($command['readConcern']))
||
in_array(array_keys($command)[0] ?? '', $this->readConcernNotSupporteedCommands))) {
if (
((isset($command['txnNumber']) && !isset($command['startTransaction']) && isset($command['readConcern']))
|| \in_array(array_key_first($command) ?? '', $this->readConcernNotSupporteedCommands))
) {
unset($command['readConcern']);
}