[Swift] How to get the document ID of Firebase

var documentId : String?

self.firestore.collection("users").document("samplesample")
            .getDocuments() { (querySnapshot, err) in
                if let err = err {
                    print("Error getting documents: \(err)")
                } else {
                     for document in querySnapshot!.documents {

                         self.documentId = document.documentID
                     }
                  }
              }

Recommended Posts

[Swift] How to get the document ID of Firebase
[jsoup] How to get the full amount of a document
[Swift5] How to get an array and the complement of arrays
[Swift UI] How to get the startup status of the application [iOS]
How to get the id of PRIMAY KEY auto_incremented in MyBatis
How to get today's day of the week
[Java] How to get the authority of the folder
[Java] How to get the URL of the transition source
[Java] How to get the maximum value of HashMap
[Android] How to get the setting language of the terminal
[Rails] How to get the contents of strong parameters
[Swift] How to get the number of elements in an array (super basic)
[Swift] How to dynamically change the height of the toolbar on the keyboard
[Swift5] How to analyze complex JSON and get the index of the element that satisfies the condition
[Rails] How to get the URL of the transition source and redirect
[Swift] How to implement the Twitter login function using Firebase UI ①
How to determine the number of parallels
How to get the contents of Map using for statement Memorandum
[Java] How to get the current directory
[Swift] Get the height of Safe Area
How to sort the List of SelectItem
How to get the date in java
[Swift] How to implement the Twitter login function using Firebase UI ②
How to overwrite Firebase data in Swift
How to get the length of an audio file in java
[Java] How to get to the front of a specific string using the String class
How to get the absolute path of a directory running in Java
[swift5] How to change the color of TabBar or the color of item of TabBar with code
How to find the cause of the Ruby error
Customize how to divide the contents of Recyclerview
[Swift] How to implement the LINE login function
[swift5] How to implement the Twitter share function
How to add sound in the app (swift)
Output of how to use the slice method
[Swift UI] How to disable ScrollsToTop of ScrollView
[Swift] How to implement the fade-in / out function
How to display the result of form input
[Java] How to get the redirected final URL
[Ruby on Rails] How to make the link destination part of the specified id
graphql-ruby: How to get the name of query or mutation in controller Note
[Swift] How to change the order of Bar Items in Tab Bar Controller [Beginner]
[Java] How to easily get the longest character string of ArrayList using stream
[Swift] Get document Id as well as document in Cloud Firestore
[Swift] Get the number of steps with CMP edometer
How to delete / update the list field of OneToMany
How to write Scala from the perspective of Java
[Ruby] How to find the sum of each digit
How to install the root certificate of Centos7 (Cybertrust)
[Rails] How to change the column name of the table
[SwiftUI] How to specify the abbreviated position of Text
As of April 2018 How to get Java 8 on Mac
How to judge the click of any area of the image
How to download the old version of Apache Tomcat
[Ruby] How to get the tens place and the ones place
[Swift] How to use UserDefaults
How to use Swift UIScrollView
How to get the class name / method name running in Java
An unsupported Java version How to get rid of errors
How to display the select field of time_select every 30 minutes
Get to the abbreviations from 5 examples of iterating Java lists
[IOS] How to get the table name from AWS DynamoDB