title: Using UpdateChildValues to delete from Firebase
body: <p>I am trying to delete data from several locations in the Firebase database simultaneously.</p>
  
  <p>The <a href="https://firebase.google.com/docs/database/ios/save-data" rel="noreferrer">Firebase docs</a> state:</p>
  
  <blockquote>
    <p>"The simplest way to delete data is to call removeValue on a reference to the location of that data.  You can also delete by specifying nil as the value for another write operation such as setValue or updateChildValues. You can use this technique with updateChildValues to delete multiple children in a single API call."</p>
  </blockquote>
  
  <p>My code is</p>
  
  <pre><code>let childUpdates = [path1 : nil,
                      path2 : nil,
                      path3 : nil,
                      path4 : nil]
  
      ref.updateChildValues(childUpdates)
  </code></pre>
  
  <p>All four paths are strings, but I get an error: </p>
  
  <blockquote>
    <p>"Type of expression is ambiguous without more context."  </p>
  </blockquote>
  
  <p>I'd assume this occurs because of the nil values, since if I replace nil with anything else (such as an Int) the error disappears.</p>
  
  <p>What is the correct way to use updateChildValues to delete data from Firebase? We want it to work in a similar way to the removeValue() function in Firebase. The reason we would prefer to do this is because it can remove from multiple places in one call.</p>