title: DocumentID is updating every time in firebase
body: <p>I'm new to firebase, singing with gmail on main view. after user singing, I'm saving the <em>userinfo</em> based on documentId, if the user already existed(already logged with gmail) person no need to save the information just update information of existed. So I tried some of the code, but I will not achieved what I'm expecting.  </p>
  
  <pre><code>func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
  
          if let error = error{
              print(error.localizedDescription)
              return
          }
          guard let authentication = user.authentication else { return }
  
          let credential = GoogleAuthProvider.credential(withIDToken: (authentication.idToken)!, accessToken: (authentication.accessToken)!)
          Auth.auth().signIn(with: credential, completion: { (user, error) in
              if let error = error {
                  print("Login erro  \(error.localizedDescription)")
                  return
              }
  </code></pre>
  
  <p>Here I check all document id in firestore</p>
  
  <pre><code>            self.db.collection("pruser").getDocuments() { (querySnapshot, err) in
                         if let err = err {
                             print("Error getting documents: \(err)")
                         } else {
                             for document in querySnapshot!.documents {
  //                               print("\(document.documentID) =&gt; \(document.data())")
                              print("\(document.documentID)")
  </code></pre>
  
  <p>Here I have to check with existed Document id's and current user 
  Document id. If already existed update info, if not set the values on Document Id but when try with this code</p>
  
  <pre><code>            self.ref = self.db.collection("pruser").document()
              let doc = self.ref?.documentID
              print("printdoucment id ",doc!)
                          }
                         }
                     }
  }
  </code></pre>
  
  <blockquote>
    <p>userid: vnRsxNjJePfwRcAWOLy1iByhV352<br> Doucment id:  PKKLapD9xE9kNNvntI8X</p>
    
    <p>userId: vnRsxNjJePfwRcAWOLy1iByhV352<br> Doucment id: 
    pxjiVXEgbZgFke3Mijk5</p>
  </blockquote>
  
  <p>when I logged with existed email also  <em>documentid</em> coming different, every login time <em>DocumentId</em> is coming different how achieve this issue? <a href="https://i.stack.imgur.com/Iv01C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Iv01C.png" alt="enter image description here"></a></p>