-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 0.1.0
-
Component/s: None
-
None
Note that the spec abstracts the new option (in the MongoDB command) as returnDocument, which is an enum with before and after values. These should probably be constants defined on either Collection or a ReturnDocument interface, or we can look at other design patterns for representing an enum in PHP (there are a few).
Usage example:
$collection->findOneAndUpdate( // Required criteria param ['x' => 1], // Required update param ['$set' => ['x' => 2]], // Optional named params in an associative array ['maxTimeMS' => 2000] );