How to update a node after loadByProperties? I search for a node with field value client id and I need to update values. How do I do that in drupal 8?
I search with the following code

$profileNode = \Drupal::entityTypeManager()
          -&gt;getStorage('node')
          -&gt;loadByProperties(['field_user_id' =&gt; $id]);


I get an array in response to this which corresponds to this. How do I update the node value with this?
Assuming you response array will contain one node as suggested by the variable name $profileNode 

here is a suggestion to make it :

$profileNode = \Drupal::entityTypeManager()
    -&gt;getStorage('node')
    -&gt;loadByProperties(['field_user_id' =&gt; $id]);
// Get the node object.
$profileNodeObject = reset($profileNode);
if ($profileNodeObject) {
  // Make the changes we want : per example set the author to user 4.
  $profileNodeObject-&gt;setOwnerId(4);
  // Save the changes.
  $profileNodeObject-&gt;save();
}