title: check collection existence - Firestore
body: <p>Example:</p>
  
  <p>I have to make an appointment with the Firestore before proceeding with the event scheduling function.</p>
  
  <pre><code>Example in the database:
  - Companie1 (Document)
  --- name
  --- phone
  --- Schedules (Collection)
  -----Event 1
  -----Event 2
  </code></pre>
  
  <p>I have a function that performs a new schedule.</p>
  
  <p>According to the example.
  I need to check if the Schedules collection exists.</p>
  
  <p>If it does not exist I execute the scheduling function. If I already exist I need to do another procedure.</p>
  
  <p>I already used this pattern and not right.</p>
  
  <pre><code>db.collection("Companies").document(IDCOMPANIE1)
          .get()
          .addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {
              @Override
              public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {
                  if (task.isSuccessful()) {
                      for (DocumentSnapshot document : task.getResult()) {
  
                      }
                  } else {
                      Log.d(TAG, "Error getting documents: ", task.getException());
                  }
              }
          });
  </code></pre>
  
  <p>I need help finding a way to do this before proceeding with the registration.</p>