title: How to look for a specific value in a DataSnapshot with Firebase Cloud Functions
body: <p>I'm trying to make a cloud function that will trigger on HTTP request (which is sent on a timer), that will remove all childs with a specific value.</p>
  
  <p>The database node looks like this:</p>
  
  <pre><code>activities
      4GI1QXUJG0MeQ8Bq19WOdCQFo9r1 //uid
          activity: "hammer"
          id: some ID
          note: "some note"
          timestamp: some timeintervalsince1970
      7IDUiufhiws8939hdfIUHiuhwdi5
          etc....
  </code></pre>
  
  <p>I want to look through all the activities, and if the activity value is "hammer", I want to remove the child.</p>
  
  <p>This is what I have so far</p>
  
  <pre><code>exports.deleteHammerNotifications = functions.https.onRequest((req, res) =&gt; {
  
      admin.database().ref('activities').once('value', (snapshot) =&gt; {
  
          console.log(snapshot.val())
  
      });
  });
  </code></pre>
  
  <p>which prints:</p>
  
  <pre><code>{ 
      '4GI1QXUJG0MeQ8Bq19WOdCQFo9r1': 
        { activity: 'nn',
          id: '4GI1QXUJG0MeQ8Bq19WOdCQFo9r1',
          note: 'Blank note...',
          timestamp: 1498032472 },
       M6xQU5XWTEVbSqBnR3HBAEhA9hI3: 
        { activity: 'hammer',
        id: 'M6xQU5XWTEVbSqBnR3HBAEhA9hI3',
        note: 'some note here...',
        timestamp: 1497973839 },
  }
  </code></pre>
  
  <p>My problem is I don't know how to cycle through the DataSnapshot and look for all the childs that has the activity: "hammer" value.
  I have done similar function in my xcode project with arrays, but I don't know how to do it with JavaScript.</p>
  
  <p>Any help is appreciated!</p>