title: Swap nested specific item in map finding by key value, the position in map
body: <p>We have a cursor or atom map with this example data:</p>
  
  <pre><code>    #&lt;Cursor: [:customer] {:name Diego Peña, 
  
      :addresses [{:id 23, :province Madrid, :country 1, :descripcion aaeeeeeeee iii oooo4444, :locality Gali gali, :country_name SPAIN, :direccion Street Cierva, :id 3, :postalcode 30203, :principal true, :customer 17} 
  
  {:id 35, :province Madrid, :country nil, :descripcion yyy lalala3, :locality Lalala, :direccion calle Maria 3 , :postalcode 333, :principal false, :customer 17} 
  
  {:id 6, :province Madrid, :country 2, :descripcion otra direccioncita444, :locality Leleele, :country_name SPAIN, :direccion Direccion calle Ooo, :postalcode 1236, :main false, :customer 17} 
  
  {:id 27, :province Madrid, :country 1, :descripcion grandisima, :locality Alcantarilla, :country_name SPAIN, :direccion C/ 3 Mayo, :postalcode 3001, :main false, :customer 17}
  
  ]}&gt;
  </code></pre>
  
  <p>I need to change the values of a searched address by id. I have managed to locate the address by the value of the id:</p>
  
  <pre><code>(defn get-address [pk]
     (-&gt;&gt; @db/customer :addresses (filter #(= (int pk) (int (:id %)))) first)
  )
  </code></pre>
  
  <p>I can change all addresses with this: <code>:ok #(swap! db/customer assoc-in [:addresses] %)})</code>. I need to change data for a <strong>specific address</strong> from the API response. </p>
  
  <p>I am close to getting it, but with this approach I am missing the position or the index of the item: <code>#(swap! db/client assoc-in [:addresses ¿position or index in map?] %)</code> we have the id of item address. </p>
  
  <p>Perhaps this approach is wrong, a better one?</p>