title: How to add and remove Firebase db trigger as part of another db trigger
body: <p>I've got a small firebase app where I'd like to add a change listener (Db Trigger) when another change happens (e.g. particular property has changed it's value to 'listen') and then remove it when that 'trigger value' changes again. Is it possible?</p>
  
  <pre><code>exports.liveLessonPracticeMonitor = functions.database.ref('/some/property/path')
      .onWrite((change, context) =&gt; {
          if (!change.before.exists() &amp;&amp; change.after.val() === 'listen') {
  
              // Can I do it here ?
  
              // start another listener. 
              functions.database.ref('/some/other/property/path')
                  .onWrite((otherChange, otherContext) =&gt; {
                      // my code
                  }
          } else if (change.before.val() === 'listen' &amp;&amp; change.after.val() === 'stop') {
              // stop listening what I've subscribed to two lines above
  
              // How to do that?
          }
  
          return null
      })
  </code></pre>