findAndModify() public method
Updates a document and returns it.
| public array|null findAndModify ( $collectionName, $condition = [], $update = [], $options = [] ) | ||
|---|---|---|
| $collectionName | ||
| $condition | array |
Query condition |
| $update | array |
Update criteria |
| $options | array |
List of options in format: optionName => optionValue. |
| return | array|null |
The original document, or the modified document when $options['new'] is set. |
Please login to continue.