Unverified Commit 4cfe1821 authored by Jeremy Mikola's avatar Jeremy Mikola Committed by GitHub

Remove pre-3.0 compat code in FindAndModify

parent 0534ed0f
...@@ -217,17 +217,6 @@ class FindAndModify implements Executable, Explainable ...@@ -217,17 +217,6 @@ class FindAndModify implements Executable, Explainable
return null; return null;
} }
/* Prior to 3.0, findAndModify returns an empty document instead of null
* when an upsert is performed and the pre-modified document was
* requested.
*/
if ($this->options['upsert'] && ! $this->options['new'] &&
isset($result->lastErrorObject->updatedExisting) &&
! $result->lastErrorObject->updatedExisting) {
return null;
}
if ( ! is_object($result->value)) { if ( ! is_object($result->value)) {
throw new UnexpectedValueException('findAndModify command did not return a "value" document'); throw new UnexpectedValueException('findAndModify command did not return a "value" document');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment