Write, Read and Update Documents in a Firestore Collection
Beginner · 30 minutes · 5 tasks, checked automatically · 100 points
In this lab you will use the Firestore REST API (via curl) and the gcloud CLI to interact with a Firestore collection running on a local emulator. You will create a collection, write documents into it, read them back, and update individual fields — all without touching a real cloud account.
What you’ll learn
- Write documents to a Firestore collection using the REST API
- Read documents from a Firestore collection and verify their contents
- Update a specific field on an existing Firestore document using a PATCH request
How this lab works
- Start the lab: One click starts an emulated cloud on your computer, with the cloud’s own CLI ready: no account and no bill.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads the emulated cloud’s resources and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: An emulated cloud on your computer: no cloud account, no bill
- Cloud: GCP
- Services: firestore
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop (or Podman / Rancher Desktop) installed and running
- A GCP sandbox created in the Local Cloud Playground
Topics: firestore, nosql, documents, collections, rest-api, crud, gcp, emulator
Create a free account to start this lab.
Keep going
- BigQuery Foundations: Create, Load, and Query Data
- Insert, Query and Update Entities in Azure Table Storage
- Getting Started with Cosmos DB: Create, Insert, and Query Documents
- Add a Global Secondary Index to a DynamoDB Table and Query It
- Prevent Lost Updates with DynamoDB Conditional Writes
- Datastore Ancestor Keys and Composite Index Queries