Creating collections and documents
📖 Scenario: You are building a simple app to store user profiles in a cloud database. Each user has a name and an email address. You will create a collection called users and add documents for each user.
🎯 Goal: Create a Firestore collection named users and add user documents with name and email fields.
📋 What You'll Learn
Create a Firestore collection called
usersAdd a document for a user with
name and email fieldsAdd a second user document with the same fields
Use Firestore's
setDoc method to add documents💡 Why This Matters
🌍 Real World
Storing user profiles or any structured data in a cloud database for web or mobile apps.
💼 Career
Understanding how to create collections and documents in Firestore is essential for backend and full-stack developers working with Firebase.
Progress0 / 4 steps