what is the use of child_added in firebase realtime database code example

Example 1: firebase search into every child

ref.child('users').orderByChild('name').equalTo('John Doe').on("value", function(snapshot) {
    console.log(snapshot.val());
    snapshot.forEach(function(data) {
        console.log(data.key);
    });
});

Example 2: firebase orderbychild update

database.ref('/app/posts')
  .orderByChild('material')
  .equalTo(materialName)
  .once('value', function (snapshot) {
    snapshot.forEach(function(child) {
      child.ref.update({material: false});
    });
});

Tags:

Misc Example