Skip to content

Instantly share code, notes, and snippets.

@yccheok
Last active September 3, 2024 14:28
Show Gist options
  • Save yccheok/3010b4fa555274249f631b7f33a4aa87 to your computer and use it in GitHub Desktop.
Save yccheok/3010b4fa555274249f631b7f33a4aa87 to your computer and use it in GitHub Desktop.
static func generateDocId() -> String {
let db = Firestore.firestore()
// Any collection name will do. This function is not supposed to perform any read/write
// operations on Firestore.
return db.collection("sandbox").document().documentID
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment