title: Android Firebase Database : Delete
body: <p>I have the following database structure:</p>
  
  <p><a href="https://i.stack.imgur.com/I9mi8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I9mi8.jpg" alt="enter image description here"></a></p>
  
  <p>I need to delete a child (both key and value), for example, the first one, by knowing his value: <code>xzFD1RahhZYr05nZljIW9BRzvSq1</code></p>
  
  <p>So I have</p>
  
  <pre><code>String itemToDelete = "xzFD1RahhZYr05nZljIW9BRzvSq1";
  FirebaseDatabase database = FirebaseDatabase.getInstance();
  databaseReference deleteRef=database.getReference("richieste").child(FirebaseAuth.getInstance().getCurrentUser().getUid());
  deleteRef.orderByValue().equalTo(itemToDelete);
  deleteRef.addListenerForSingleValueEvent(new ValueEventListener() {
      @Override
      public void onDataChange(DataSnapshot dataSnapshot) {
          //What to do with .removeValue(); ?
      }
      @Override
      public void onCancelled(DatabaseError databaseError) {
  
      }
  }
  </code></pre>
  
  <p>I don't know exactly what to do with <code>dataSnapshot</code> to remove the child</p>
  
  <p>Thank you for the answer</p>
  
  <hr>
  
  <p>Bonus question: what should I do with <code>onCancelled</code> event?</p>