Code
<?php

$m 
= new MongoClient();

$test $m->selectDb('test');

$coll $test->selectCollection('my_table');

// without $set, the whole document will be replaced
$success $coll->update(
    array(
'_id' => new MongoId('5421399f895f69524d8b4567')),
    array(
'$set' => array('value' => 'nothing'))
);

dump($success);


/*
resulting changes with $set

array(4) {
  ["_id"]=>
  object(MongoId)#8 (1) {
    ["id"]=>
    string(24) "5421399f895f69524d8b4567"
  }
  ["name"]=>
  string(17) "myname"
  ["object"]=>
  array(0) {
  }
  ["value"]=>
  string(7) "nothing"
}
*/
Result
^ array:5 [
"updatedExisting" => true
"n" => 1
"connectionId" => 21
"err" => null
"ok" => 1.0
]
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8