php8.5
Home/ Manual/ mysql_xdevapi / collectionmodify/ CollectionModify::patch

CollectionModify::patch

PHP function Edit on GitHub ✎

Patch document

Description

mysql_xdevapi\CollectionModify::patch(string $document): mysql_xdevapi\CollectionModify

Takes a patch object and applies it on one or more documents, and can update multiple document properties.

Parameters

document

A document with the properties to apply to the matching documents.

Return Values

A CollectionModify object.

Examples

mysql_xdevapi\CollectionModify::patch() example

php
<?php

$res = $coll->modify('"Programmatore" IN job')->patch('{"Hobby" : "Programmare"}')->execute();

?>

Source: reference/mysql_xdevapi/mysql_xdevapi/collectionmodify/patch.xml · from the official PHP manual (php/doc-en)