title: Trigger Cloud Function based on Firestore changes
body: <p>I want to trigger my Cloud function whenever a document is changed(created, modified, removed) for a particular club. My cloud function should capture what data is altered and further publish it to pub/sub.</p>
  
  <p>All this in python.</p>
  
  <p>I tried like this :</p>
  
  <p><code>query = db.collection('cities')
   query_watch = col_query.on_snapshot(callback)</code></p>
  
  <p>cities -> Firestore collection.</p>
  
  <p>This is my callback function -</p>
  
  <pre><code>def callback(col_snapshot, changes, read_time):
  print('callback.')
  </code></pre>
  
  <p>This query_watch is of type Watch object. How can I extract details from it like what is the delta.?</p>
  
  <p>followed this doc - <a href="https://firebase.google.com/docs/firestore/query-data/listen" rel="nofollow noreferrer">https://firebase.google.com/docs/firestore/query-data/listen</a></p>