Recall & Review
beginner
What is a Document ID in Firebase Firestore?
A Document ID is a unique identifier for each document in a Firestore collection. It helps to find, update, or delete that specific document.
Click to reveal answer
beginner
What are the two main ways to create Document IDs in Firestore?
You can either let Firestore auto-generate a random unique ID or create your own custom ID based on your app's needs.Click to reveal answer
intermediate
Why might you choose to use custom Document IDs instead of auto-generated ones?
Custom IDs can make documents easier to find and organize if they follow a meaningful pattern, like user emails or product codes.
Click to reveal answer
intermediate
What is a risk of using predictable Document IDs?
Predictable IDs can lead to security risks if unauthorized users guess IDs and access data they shouldn’t see.
Click to reveal answer
advanced
How does Firestore generate auto IDs?
Firestore creates a 20-character string with random letters and numbers to ensure uniqueness and avoid collisions.
Click to reveal answer
What does Firestore use as a Document ID if you don't specify one?
✗ Incorrect
Firestore auto-generates a random unique string as the Document ID if you don't provide one.
Which of these is a benefit of using custom Document IDs?
✗ Incorrect
Custom IDs can be meaningful and easier to remember or organize, but they don't automatically improve security or speed.
What is a potential downside of using predictable Document IDs?
✗ Incorrect
Predictable IDs can be guessed, which may expose data to unauthorized access.
How long is a Firestore auto-generated Document ID?
✗ Incorrect
Firestore generates a 20-character string for auto IDs to ensure uniqueness.
Which strategy is best when you need to reference documents by a known key like a username?
✗ Incorrect
Custom Document IDs let you use meaningful keys like usernames for easy reference.
Explain the difference between auto-generated and custom Document IDs in Firestore.
Think about how Firestore creates IDs and why you might want to choose your own.
You got /4 concepts.
Describe a scenario where using custom Document IDs might cause security concerns.
Consider what happens if someone guesses a document's ID.
You got /4 concepts.