title: How to update a array value inside a dict value
body: <p><img src="https://i.stack.imgur.com/h4flY.png" alt="enter image description here" /></p>
  <p>I have a dict with key and value. In value i have a dict with key and a array value again. I want to know how to append datas inside that array value with pymongo ?!</p>
  <pre><code>i = mycol2.find_one({&quot;chat_action&quot;:{&quot;$exists&quot;:True}})
  mycol2.update_one(i,{&quot;$push&quot;:{&quot;chat_action&quot;:{&quot;fake_play&quot;:76}}})
  </code></pre>
  <p>I try this but i got this error :</p>
  <blockquote>
  <p>raise WriteError(error.get(&quot;errmsg&quot;), error.get(&quot;code&quot;), error)
  pymongo.errors.WriteError: The field 'chat_action' must be an array but is of type object in document {_id: ObjectId('62eaafa3886a0c39b0961b0a')}, full error: {'index': 0, 'code': 2, 'errmsg': &quot;The field 'chat_action' must be an array but is of type object in document {_id: ObjectId('62eaafa3886a0c39b0961b0a')}&quot;}</p>
  </blockquote>