title: Postgres update jsonb fields
body: <p>I have a table "profile" with a <code>jsonb</code> field called "payment_methods".
  The jsonb field structure is this:</p>
  
  <pre><code>[{"name": "paypal", "primary": false}, 
   {"name": "braintree", "primary": true}, 
   {"name": "skrill", "primary": false}]
  </code></pre>
  
  <p>I want to make a query to dynamically set the primary payment method to the method that user will choose. If the user choose the paypal method as primary, i want to set the <code>jsonb</code> field like this:</p>
  
  <pre><code>[{"name": "paypal", "primary": true}, 
   {"name": "braintree", "primary": false}, 
   {"name": "skrill", "primary": false}]
  </code></pre>
  
  <p>So, i want to update the paypal's primary filed to true and any other payment method's primary field to false.</p>
  
  <p>Notice: I want to filter with the name field. So if user give me for example paypal i want to set it as primary.</p>
  
  <p>How can i do that?</p>