March 2019
Intermediate to advanced
394 pages
11h 4m
English
Updating documents has a similar interface with the ->updateOne() OR ->updateMany() method.
The first parameter is the query used to find documents and the second one will update our documents.
We can use any of the update operators explained at the end of this chapter to update in place, or specify a new document to completely replace the document in the query:
$result = $collection->updateOne( array( "isbn" => "401"), array( '$set' => array( "price" => 39 ) ));
The ...
Read now
Unlock full access