title: Firebase Database setValue() and updateChildren() overwrites previous value
body: <p>I tried to insert new data into a table in Firebase real-time database, but <code>setValue()</code> and <code>updateChildren()</code> both are overwritten previous table and value.</p>
  
  <p>I know that <code>setValue()</code> is replacing previous data, but in my case, <code>updateChildren()</code> is also overwriting previous data.</p>
  
  <p>In the <code>Firebase console</code>, It seems like both methods are <code>delete</code> the previous table and create a new table.</p>
  
  <p><strong><code>Firebase console</code> when <code>updateChildren()</code> is executed</strong>
  <a href="https://i.stack.imgur.com/A4Pnj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A4Pnj.png" alt="enter image description here"></a></p>
  
  <p>Is my code wrong?</p>
  
  <p><strong>My database structure is:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/lcqBU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lcqBU.png" alt="enter image description here"></a></p>
  
  <pre><code>-accounts
      - $userId
          - missions
              - $productId
                  - ...
  </code></pre>
  
  <p>and Code is:</p>
  
  <pre><code>val missionsReference = FirebaseDatabase.getInstance().getReference("accounts").child(userId).child("missions")
  val mission = Mission(product.id, product.imageUrl, product.title, product.logoUrl, remain.timeInMillis, "", -1, snsAddress)
  missionsReference.child(product.id).setValue(mission)
  
  val missionValue: Map&lt;String, Any&gt; = mission.toMap()
  val missionUpdate: HashMap&lt;String, Any&gt; = HashMap()
  missionUpdate[product.id] = missionValue
  missionsReference.updateChildren(missionUpdate)
  /* I also tried following methods, but it overwrites too.
  FirebaseDatabase.getInstance().getReference("accounts/$userId/missions/${product.id}").setValue(mission)
  missionsReference.push().setValue(mission)
  */
  </code></pre>