title: cloud function using typrescript and if statment
body: <p>hello I'm new to cloud functions and I want to ask if there is some why to get more than one topic in one if statement
  here is my cloud function :</p>
  <pre><code>import * as functions from 'firebase-functions';
  import * as admin from 'firebase-admin';
  admin.initializeApp();
  
  const fcm = admin.messaging();
  
  export const sendToTopic = functions.firestore
    .document(&quot;Doctor2019/{documentId}&quot;)
    .onCreate(async snapshot =&gt; {
  
      const payload: admin.messaging.MessagingPayload = {
        notification: {
          title: 'NEW POST!',
          body: `Click here to see New Post`,
          icon: 'your-icon-url',
          click_action: 'FLUTTER_NOTIFICATION_CLICK'
        }
      };
  
      return fcm.sendToTopic('Doctor2019', payload);
    });
  
  
  </code></pre>
  <p>the problem is that I have more than one topic what I want to do is to check the creation of document on other collections and send the notification based on that , I really don't know what to do , any help ?</p>