Webiny\Component\Mongo\Bridge\MongoInterface::update PHP Method

update() public method

Updates all documents matching the filter.
See also: http://docs.mongodb.org/manual/reference/command/update/
public update ( string $collectionName, array | object $filter, array | object $update, array $options = [] ) : MongoDB\UpdateResult
$collectionName string
$filter array | object Query by which to filter documents
$update array | object Update to apply to the matched documents
$options array Command options
return MongoDB\UpdateResult
    public function update($collectionName, $filter, $update, array $options = []);

Usage Example

Example #1
0
 public function update($collectionName, $filter, $update, array $options = [])
 {
     return $this->bridge->update($this->cName($collectionName), $filter, $update, $options);
 }