title: Update the value of an attribute in a postgresql jsonb array of objects across muliple records
body: <p>I am trying to update a value tit in three database records that is part of a jsonb array object to change the title of gid 1 to 'newTitle Group 1' from just 'group 1' using postgresql and python.</p>
  <pre><code>create table groups (name varchar, grp jsonb)
   insert into groups (name, grp) values 
    ('joe', [{&quot;gid&quot;: &quot;1&quot;, &quot;ona&quot;: &quot;joe&quot;, &quot;tit&quot;: &quot;group 1 &quot;}, {&quot;gid&quot;: &quot;2&quot;, &quot;ona&quot;: &quot;harry&quot;, &quot;tit&quot;: &quot;tester1 group 2&quot;}, {&quot;gid&quot;: &quot;3&quot;, &quot;ona&quot;: &quot;moe&quot;, &quot;tit&quot;: &quot;group 3&quot;}]),
    ('harry', [{&quot;gid&quot;: &quot;1&quot;, &quot;ona&quot;: &quot;joe&quot;, &quot;tit&quot;: &quot;group 1 &quot;}, {&quot;gid&quot;: &quot;2&quot;, &quot;ona&quot;: &quot;harry&quot;, &quot;tit&quot;: &quot;tester1 group 2&quot;}, {&quot;gid&quot;: &quot;3&quot;, &quot;ona&quot;: &quot;moe&quot;, &quot;tit&quot;: &quot;group 3&quot;}])
    ('moe' , [{&quot;gid&quot;: &quot;1&quot;, &quot;ona&quot;: &quot;joe&quot;, &quot;tit&quot;: &quot;group 1 &quot;}, {&quot;gid&quot;: &quot;2&quot;, &quot;ona&quot;: &quot;harry&quot;, &quot;tit&quot;: &quot;tester1 group 2&quot;}, {&quot;gid&quot;: &quot;3&quot;, &quot;ona&quot;: &quot;moe&quot;, &quot;tit&quot;: &quot;group 3&quot;}])
  </code></pre>
  <p>I want to get the result:</p>
  <pre><code>  ('joe', [{&quot;gid&quot;: &quot;1&quot;, &quot;ona&quot;: &quot;joe&quot;, &quot;tit&quot;: &quot;newTitle Group 1'&quot;}, {&quot;gid&quot;: &quot;2&quot;, &quot;ona&quot;: &quot;harry&quot;, &quot;tit&quot;: &quot;tester1 group 2&quot;}, {&quot;gid&quot;: &quot;3&quot;, &quot;ona&quot;: &quot;moe&quot;, &quot;tit&quot;: &quot;group 3&quot;}]),
    ('harry', [{&quot;gid&quot;: &quot;1&quot;, &quot;ona&quot;: &quot;joe&quot;, &quot;tit&quot;: &quot;newTitle Group 1'&quot;}, {&quot;gid&quot;: &quot;2&quot;, &quot;ona&quot;: &quot;harry&quot;, &quot;tit&quot;: &quot;tester1 group 2&quot;}, {&quot;gid&quot;: &quot;3&quot;, &quot;ona&quot;: &quot;moe&quot;, &quot;tit&quot;: &quot;group 3&quot;}])
    ('moe' , [{&quot;gid&quot;: &quot;1&quot;, &quot;ona&quot;: &quot;joe&quot;, &quot;tit&quot;: &quot;newTitle Group 1'&quot;}, {&quot;gid&quot;: &quot;2&quot;, &quot;ona&quot;: &quot;harry&quot;, &quot;tit&quot;: &quot;tester1 group 2&quot;}, {&quot;gid&quot;: &quot;3&quot;, &quot;ona&quot;: &quot;moe&quot;, &quot;tit&quot;: &quot;group 3&quot;}])
  </code></pre>
  <p>I have not found a way to do it, please help. Seems like most of the postgresql 9.5 capabilities are for jsonb objects but not arrays of objects.</p>
  <p>I tried to use many examples on the web but all seemed to fail. I also would consider using a where clause statement on the actual query to limit the jsonb records being searched by for example including <code>WHERE name IN ('harry', 'moe')</code> but for now just need to see how this basic update issue is solved.</p>