Skip to content

Commit 9813df1

Browse files
authored
Merge pull request #561 from mongodb/pre-3_0-fam
Remove pre-3.0 compat code in FindAndModify
2 parents 0534ed0 + 4cfe182 commit 9813df1

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/Operation/FindAndModify.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,6 @@ public function execute(Server $server)
217217
return null;
218218
}
219219

220-
/* Prior to 3.0, findAndModify returns an empty document instead of null
221-
* when an upsert is performed and the pre-modified document was
222-
* requested.
223-
*/
224-
if ($this->options['upsert'] && ! $this->options['new'] &&
225-
isset($result->lastErrorObject->updatedExisting) &&
226-
! $result->lastErrorObject->updatedExisting) {
227-
228-
return null;
229-
}
230-
231220
if ( ! is_object($result->value)) {
232221
throw new UnexpectedValueException('findAndModify command did not return a "value" document');
233222
}

0 commit comments

Comments
 (0)