title: In Firebase iOS SDK, .childAdded is triggered every time a child is deleted. How can I stop this?
body: <p>I am storing some data under a node called "notifications" within my Firebase database. When I add an event observer to "notifications" and set the event type to ".childAdded" the completion handler is called every time a child is added to the "notifications" node AND every time a child is deleted from the "notifications" node. First of all, I don't understand why this is happening as nothing is being added, only deleted. Is there some way to avoid this? </p>
  
  <p>If I can't avoid the .childAdded block executing every time a child is deleted, is there someway to detect that it was actually a child deleted event and not a child added event? I would like to do an early return from the function if the event was child deleted. Below is my code for reference: </p>
  
  <pre><code>//Event observer for notifications 
  notificationsReference.queryLimited(toLast: 1).observe(.childAdded, with: {
          (snapshot) in
  
          //Do some stuff here only on .childAdded 
          //If the event was child deleted, do nothing 
  })
  </code></pre>