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